From 9d764bfb4932072da16df3d52d56d0f72da875e4 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Fri, 13 Jun 2025 09:34:25 -0700 Subject: [PATCH 1/7] 25.6.0 - Added A1099 to SDK - refactored Request object for SDK naming --- Gemfile | 4 +- Gemfile.lock | 67 +- README.md | 249 +- docs/A1099/V2/Attribute.md | 48 + docs/A1099/V2/AuthorizedApiRequestModel.md | 20 + .../V2/AuthorizedApiRequestV2DataModel.md | 22 + docs/A1099/V2/BaseCompanyModel.md | 50 + docs/A1099/V2/BaseFormListRequest.md | 18 + docs/A1099/V2/BulkUpsert1099FormsRequest.md | 55 + docs/A1099/V2/CompaniesW9Api.md | 424 +++ .../V2/CompanyCreateUpdateRequestModel.md | 50 + docs/A1099/V2/CompanyModel.md | 60 + docs/A1099/V2/CompanyResponse.md | 56 + docs/A1099/V2/CompanyResponseModel.md | 56 + docs/A1099/V2/Data.md | 24 + docs/A1099/V2/ErrorModel.md | 28 + docs/A1099/V2/ErrorResponse.md | 20 + docs/A1099/V2/ErrorResponseErrorsInner.md | 49 + docs/A1099/V2/Form1099Base.md | 82 + docs/A1099/V2/Form1099DivList.md | 20 + docs/A1099/V2/Form1099DivListItem.md | 104 + docs/A1099/V2/Form1099DivRequest.md | 106 + docs/A1099/V2/Form1099K.md | 122 + docs/A1099/V2/Form1099KList.md | 20 + docs/A1099/V2/Form1099KListItem.md | 106 + docs/A1099/V2/Form1099KRequest.md | 108 + docs/A1099/V2/Form1099List.md | 18 + docs/A1099/V2/Form1099ListDataInner.md | 53 + docs/A1099/V2/Form1099Misc.md | 110 + docs/A1099/V2/Form1099MiscList.md | 20 + docs/A1099/V2/Form1099MiscListItem.md | 98 + docs/A1099/V2/Form1099MiscRequest.md | 100 + docs/A1099/V2/Form1099Nec.md | 88 + docs/A1099/V2/Form1099NecList.md | 20 + docs/A1099/V2/Form1099NecListItem.md | 74 + docs/A1099/V2/Form1099NecRequest.md | 76 + docs/A1099/V2/Form1099ProccessResult.md | 18 + docs/A1099/V2/Form1099R.md | 122 + docs/A1099/V2/Form1099RList.md | 20 + docs/A1099/V2/Form1099RListItem.md | 106 + docs/A1099/V2/Form1099RRequest.md | 108 + docs/A1099/V2/Form1099StatusDetail.md | 20 + docs/A1099/V2/FormRequestBase.md | 64 + docs/A1099/V2/FormRequestModel.md | 38 + docs/A1099/V2/FormResponseBase.md | 54 + docs/A1099/V2/FormSingleRequestBase.md | 66 + docs/A1099/V2/Forms1099Api.md | 576 ++++ docs/A1099/V2/FormsW9Api.md | 660 +++++ docs/A1099/V2/HttpValidationProblemDetails.md | 28 + docs/A1099/V2/ICreateForm1099Request.md | 51 + docs/A1099/V2/IUpdateForm1099Request.md | 51 + docs/A1099/V2/IW9FormDataModelsOneOf.md | 55 + docs/A1099/V2/IssuerCommand.md | 46 + docs/A1099/V2/IssuerResponse.md | 52 + docs/A1099/V2/Issuers1099Api.md | 423 +++ docs/A1099/V2/JobResult.md | 52 + docs/A1099/V2/Jobs1099Api.md | 87 + docs/A1099/V2/Link.md | 18 + docs/A1099/V2/PaginatedQueryResultModel.md | 22 + ...aginatedQueryResultModelCompanyResponse.md | 22 + ...PaginatedQueryResultModelIssuerResponse.md | 22 + docs/A1099/V2/PaginatedW9FormsModel.md | 22 + docs/A1099/V2/ProblemDetails.md | 26 + docs/A1099/V2/StateAndLocalWithholding.md | 32 + .../V2/StateAndLocalWithholdingRequest.md | 32 + docs/A1099/V2/StateEfileStatusDetail.md | 22 + docs/A1099/V2/SubstantialUsOwnerResponse.md | 22 + docs/A1099/V2/ValidationError.md | 20 + docs/A1099/V2/W4FormDataModel.md | 440 +++ docs/A1099/V2/W4FormResponse.md | 82 + docs/A1099/V2/W8BenEFormResponse.md | 236 ++ .../V2/W8BenESubstantialUsOwnerDataModel.md | 22 + docs/A1099/V2/W8BenFormDataModel.md | 440 +++ docs/A1099/V2/W8BenFormResponse.md | 96 + docs/A1099/V2/W8BeneFormDataModel.md | 440 +++ docs/A1099/V2/W8ImyFormDataModel.md | 440 +++ docs/A1099/V2/W8ImyFormResponse.md | 266 ++ docs/A1099/V2/W9FormBaseResponse.md | 44 + docs/A1099/V2/W9FormDataModel.md | 440 +++ docs/A1099/V2/W9FormResponse.md | 80 + docs/EInvoicing/V1/BadDownloadRequest.md | 2 +- docs/EInvoicing/V1/BadRequest.md | 2 +- docs/EInvoicing/V1/BatchSearch.md | 14 +- docs/EInvoicing/V1/BatchSearchListResponse.md | 6 +- .../V1/BatchSearchParticipants202Response.md | 22 + docs/EInvoicing/V1/ConditionalForField.md | 2 +- docs/EInvoicing/V1/DataInputField.md | 2 +- .../EInvoicing/V1/DataInputFieldNotUsedFor.md | 2 +- .../V1/DataInputFieldOptionalFor.md | 2 +- .../V1/DataInputFieldRequiredFor.md | 2 +- docs/EInvoicing/V1/DataInputFieldsApi.md | 194 +- docs/EInvoicing/V1/DataInputFieldsResponse.md | 2 +- docs/EInvoicing/V1/DirectorySearchResponse.md | 6 +- .../V1/DirectorySearchResponseValueInner.md | 8 +- ...ySearchResponseValueInnerAddressesInner.md | 12 +- ...earchResponseValueInnerIdentifiersInner.md | 6 +- ...seValueInnerSupportedDocumentTypesInner.md | 10 +- docs/EInvoicing/V1/DocumentFetch.md | 2 +- docs/EInvoicing/V1/DocumentListResponse.md | 2 +- docs/EInvoicing/V1/DocumentStatusResponse.md | 2 +- docs/EInvoicing/V1/DocumentSubmissionError.md | 2 +- docs/EInvoicing/V1/DocumentSubmitResponse.md | 2 +- docs/EInvoicing/V1/DocumentSummary.md | 4 +- docs/EInvoicing/V1/DocumentsApi.md | 870 +++--- docs/EInvoicing/V1/ErrorResponse.md | 4 +- docs/EInvoicing/V1/EventId.md | 18 + docs/EInvoicing/V1/EventMessage.md | 32 + docs/EInvoicing/V1/EventPayload.md | 20 + docs/EInvoicing/V1/EventSubscription.md | 18 + docs/EInvoicing/V1/FetchDocumentsRequest.md | 2 +- .../V1/FetchDocumentsRequestDataInner.md | 2 +- .../V1/FetchDocumentsRequestMetadata.md | 6 +- docs/EInvoicing/V1/ForbiddenError.md | 2 +- docs/EInvoicing/V1/HmacSignature.md | 20 + docs/EInvoicing/V1/HmacSignatureValue.md | 20 + docs/EInvoicing/V1/Id.md | 18 + docs/EInvoicing/V1/InputDataFormats.md | 2 +- docs/EInvoicing/V1/InternalServerError.md | 2 +- docs/EInvoicing/V1/InteropApi.md | 190 +- docs/EInvoicing/V1/Mandate.md | 16 +- docs/EInvoicing/V1/MandateDataInputField.md | 2 +- .../V1/MandateDataInputFieldNamespace.md | 2 +- docs/EInvoicing/V1/MandatesApi.md | 366 +-- docs/EInvoicing/V1/MandatesResponse.md | 2 +- docs/EInvoicing/V1/NotFoundError.md | 2 +- docs/EInvoicing/V1/NotUsedForField.md | 2 +- docs/EInvoicing/V1/OutputDataFormats.md | 20 + docs/EInvoicing/V1/Pagination.md | 20 + docs/EInvoicing/V1/RequiredWhenField.md | 2 +- docs/EInvoicing/V1/Signature.md | 18 + docs/EInvoicing/V1/SignatureSignature.md | 22 + docs/EInvoicing/V1/SignatureValue.md | 18 + docs/EInvoicing/V1/SignatureValueSignature.md | 22 + docs/EInvoicing/V1/StatusEvent.md | 2 +- docs/EInvoicing/V1/SubmitDocumentMetadata.md | 6 +- .../V1/SubmitInteropDocument202Response.md | 2 +- docs/EInvoicing/V1/SubscriptionCommon.md | 20 + docs/EInvoicing/V1/SubscriptionDetail.md | 26 + .../EInvoicing/V1/SubscriptionListResponse.md | 22 + .../EInvoicing/V1/SubscriptionRegistration.md | 24 + docs/EInvoicing/V1/SubscriptionsApi.md | 348 +++ docs/EInvoicing/V1/SuccessResponse.md | 20 + docs/EInvoicing/V1/TradingPartnersApi.md | 897 +++--- docs/EInvoicing/V1/WebhookInvocation.md | 28 + docs/EInvoicing/V1/WebhooksErrorInfo.md | 24 + docs/EInvoicing/V1/WebhooksErrorResponse.md | 18 + docs/EInvoicing/V1/WorkflowIds.md | 2 +- lib/avalara_sdk.rb | 154 +- .../api/A1099/V2/companies_w9_api.rb | 952 +++++++ lib/avalara_sdk/api/A1099/V2/forms1099_api.rb | 1191 ++++++++ lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb | 1326 +++++++++ .../api/A1099/V2/issuers1099_api.rb | 952 +++++++ lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb | 354 +++ .../EInvoicing/V1/data_input_fields_api.rb | 8 +- .../api/EInvoicing/V1/documents_api.rb | 64 +- .../api/EInvoicing/V1/interop_api.rb | 10 +- .../api/EInvoicing/V1/mandates_api.rb | 14 +- .../api/EInvoicing/V1/subscriptions_api.rb | 829 ++++++ .../api/EInvoicing/V1/trading_partners_api.rb | 54 +- lib/avalara_sdk/api_client.rb | 12 +- lib/avalara_sdk/configuration.rb | 75 +- lib/avalara_sdk/models/A1099/V2/attribute.rb | 379 +++ .../A1099/V2/authorized_api_request_model.rb | 221 ++ .../authorized_api_request_v2_data_model.rb | 232 ++ .../models/A1099/V2/base_company_model.rb | 356 +++ .../models/A1099/V2/base_form_list_request.rb | 210 ++ .../A1099/V2/bulk_upsert1099_forms_request.rb | 104 + .../V2/company_create_update_request_model.rb | 363 +++ .../models/A1099/V2/company_model.rb | 413 +++ .../models/A1099/V2/company_response.rb | 400 +++ .../models/A1099/V2/company_response_model.rb | 390 +++ lib/avalara_sdk/models/A1099/V2/data.rb | 237 ++ .../models/A1099/V2/error_model.rb | 263 ++ .../models/A1099/V2/error_response.rb | 229 ++ .../A1099/V2/error_response_errors_inner.rb | 101 + .../models/A1099/V2/form1099_base.rb | 535 ++++ .../models/A1099/V2/form1099_div_list.rb | 238 ++ .../models/A1099/V2/form1099_div_list_item.rb | 604 ++++ .../models/A1099/V2/form1099_div_request.rb | 613 +++++ lib/avalara_sdk/models/A1099/V2/form1099_k.rb | 784 ++++++ .../models/A1099/V2/form1099_k_list.rb | 238 ++ .../models/A1099/V2/form1099_k_list_item.rb | 676 +++++ .../models/A1099/V2/form1099_k_request.rb | 639 +++++ .../models/A1099/V2/form1099_list.rb | 219 ++ .../A1099/V2/form1099_list_data_inner.rb | 103 + .../models/A1099/V2/form1099_misc.rb | 681 +++++ .../models/A1099/V2/form1099_misc_list.rb | 238 ++ .../A1099/V2/form1099_misc_list_item.rb | 577 ++++ .../models/A1099/V2/form1099_misc_request.rb | 586 ++++ .../models/A1099/V2/form1099_nec.rb | 571 ++++ .../models/A1099/V2/form1099_nec_list.rb | 238 ++ .../models/A1099/V2/form1099_nec_list_item.rb | 469 ++++ .../models/A1099/V2/form1099_nec_request.rb | 478 ++++ .../A1099/V2/form1099_proccess_result.rb | 210 ++ lib/avalara_sdk/models/A1099/V2/form1099_r.rb | 742 +++++ .../models/A1099/V2/form1099_r_list.rb | 238 ++ .../models/A1099/V2/form1099_r_list_item.rb | 660 +++++ .../models/A1099/V2/form1099_r_request.rb | 622 +++++ .../models/A1099/V2/form1099_status_detail.rb | 221 ++ .../models/A1099/V2/form_request_base.rb | 417 +++ .../models/A1099/V2/form_request_model.rb | 345 +++ .../models/A1099/V2/form_response_base.rb | 372 +++ .../A1099/V2/form_single_request_base.rb | 433 +++ .../V2/http_validation_problem_details.rb | 269 ++ .../A1099/V2/i_create_form1099_request.rb | 102 + .../A1099/V2/i_update_form1099_request.rb | 102 + .../models/A1099/V2/issuer_command.rb | 364 +++ .../models/A1099/V2/issuer_response.rb | 390 +++ .../A1099/V2/iw9_form_data_models_one_of.rb | 105 + lib/avalara_sdk/models/A1099/V2/job_result.rb | 366 +++ lib/avalara_sdk/models/A1099/V2/link.rb | 210 ++ .../A1099/V2/paginated_query_result_model.rb | 234 ++ ...ted_query_result_model_company_response.rb | 234 ++ ...ated_query_result_model_issuer_response.rb | 234 ++ .../A1099/V2/paginated_w9_forms_model.rb | 231 ++ .../models/A1099/V2/problem_details.rb | 251 ++ .../A1099/V2/state_and_local_withholding.rb | 281 ++ .../V2/state_and_local_withholding_request.rb | 273 ++ .../A1099/V2/state_efile_status_detail.rb | 231 ++ .../A1099/V2/substantial_us_owner_response.rb | 233 ++ .../models/A1099/V2/validation_error.rb | 229 ++ .../models/A1099/V2/w4_form_data_model.rb | 2443 +++++++++++++++++ .../models/A1099/V2/w4_form_response.rb | 557 ++++ .../models/A1099/V2/w8_ben_e_form_response.rb | 1356 +++++++++ ...8_ben_e_substantial_us_owner_data_model.rb | 231 ++ .../models/A1099/V2/w8_ben_form_data_model.rb | 2442 ++++++++++++++++ .../models/A1099/V2/w8_ben_form_response.rb | 631 +++++ .../A1099/V2/w8_bene_form_data_model.rb | 2423 ++++++++++++++++ .../models/A1099/V2/w8_imy_form_data_model.rb | 2443 +++++++++++++++++ .../models/A1099/V2/w8_imy_form_response.rb | 1497 ++++++++++ .../models/A1099/V2/w9_form_base_response.rb | 347 +++ .../models/A1099/V2/w9_form_data_model.rb | 2442 ++++++++++++++++ .../models/A1099/V2/w9_form_response.rb | 542 ++++ .../EInvoicing/V1/bad_download_request.rb | 22 +- .../models/EInvoicing/V1/bad_request.rb | 22 +- .../models/EInvoicing/V1/batch_search.rb | 25 +- .../V1/batch_search_list_response.rb | 22 +- .../batch_search_participants202_response.rb | 231 ++ .../EInvoicing/V1/conditional_for_field.rb | 22 +- .../models/EInvoicing/V1/data_input_field.rb | 22 +- .../V1/data_input_field_not_used_for.rb | 22 +- .../V1/data_input_field_optional_for.rb | 22 +- .../V1/data_input_field_required_for.rb | 22 +- .../V1/data_input_fields_response.rb | 25 +- .../V1/directory_search_response.rb | 22 +- .../directory_search_response_value_inner.rb | 22 +- ...ch_response_value_inner_addresses_inner.rb | 22 +- ..._response_value_inner_identifiers_inner.rb | 22 +- ...ue_inner_supported_document_types_inner.rb | 22 +- .../models/EInvoicing/V1/document_fetch.rb | 25 +- .../EInvoicing/V1/document_list_response.rb | 22 +- .../EInvoicing/V1/document_status_response.rb | 22 +- .../V1/document_submission_error.rb | 22 +- .../EInvoicing/V1/document_submit_response.rb | 22 +- .../models/EInvoicing/V1/document_summary.rb | 34 +- .../models/EInvoicing/V1/error_response.rb | 25 +- .../models/EInvoicing/V1/event_id.rb | 218 ++ .../models/EInvoicing/V1/event_message.rb | 322 +++ .../models/EInvoicing/V1/event_payload.rb | 241 ++ .../EInvoicing/V1/event_subscription.rb | 225 ++ .../EInvoicing/V1/fetch_documents_request.rb | 24 +- .../V1/fetch_documents_request_data_inner.rb | 24 +- .../V1/fetch_documents_request_metadata.rb | 60 +- .../models/EInvoicing/V1/forbidden_error.rb | 22 +- .../models/EInvoicing/V1/hmac_signature.rb | 270 ++ .../EInvoicing/V1/hmac_signature_value.rb | 270 ++ lib/avalara_sdk/models/EInvoicing/V1/id.rb | 219 ++ .../EInvoicing/V1/input_data_formats.rb | 22 +- .../EInvoicing/V1/internal_server_error.rb | 22 +- .../models/EInvoicing/V1/mandate.rb | 95 +- .../EInvoicing/V1/mandate_data_input_field.rb | 22 +- .../V1/mandate_data_input_field_namespace.rb | 22 +- .../models/EInvoicing/V1/mandates_response.rb | 22 +- .../models/EInvoicing/V1/not_found_error.rb | 22 +- .../EInvoicing/V1/not_used_for_field.rb | 22 +- .../EInvoicing/V1/output_data_formats.rb | 223 ++ .../models/EInvoicing/V1/pagination.rb | 222 ++ .../EInvoicing/V1/required_when_field.rb | 25 +- .../models/EInvoicing/V1/signature.rb | 218 ++ .../EInvoicing/V1/signature_signature.rb | 297 ++ .../models/EInvoicing/V1/signature_value.rb | 218 ++ .../V1/signature_value_signature.rb | 297 ++ .../models/EInvoicing/V1/status_event.rb | 22 +- .../EInvoicing/V1/submit_document_metadata.rb | 44 +- .../V1/submit_interop_document202_response.rb | 22 +- .../EInvoicing/V1/subscription_common.rb | 229 ++ .../EInvoicing/V1/subscription_detail.rb | 288 ++ .../V1/subscription_list_response.rb | 240 ++ .../V1/subscription_registration.rb | 270 ++ .../models/EInvoicing/V1/success_response.rb | 222 ++ .../EInvoicing/V1/webhook_invocation.rb | 291 ++ .../EInvoicing/V1/webhooks_error_info.rb | 242 ++ .../EInvoicing/V1/webhooks_error_response.rb | 211 ++ .../models/EInvoicing/V1/workflow_ids.rb | 22 +- spec/api_client_spec.rb | 70 - spec/integration/documentsapi_test_spec.rb | 4 +- 296 files changed, 60900 insertions(+), 2088 deletions(-) create mode 100644 docs/A1099/V2/Attribute.md create mode 100644 docs/A1099/V2/AuthorizedApiRequestModel.md create mode 100644 docs/A1099/V2/AuthorizedApiRequestV2DataModel.md create mode 100644 docs/A1099/V2/BaseCompanyModel.md create mode 100644 docs/A1099/V2/BaseFormListRequest.md create mode 100644 docs/A1099/V2/BulkUpsert1099FormsRequest.md create mode 100644 docs/A1099/V2/CompaniesW9Api.md create mode 100644 docs/A1099/V2/CompanyCreateUpdateRequestModel.md create mode 100644 docs/A1099/V2/CompanyModel.md create mode 100644 docs/A1099/V2/CompanyResponse.md create mode 100644 docs/A1099/V2/CompanyResponseModel.md create mode 100644 docs/A1099/V2/Data.md create mode 100644 docs/A1099/V2/ErrorModel.md create mode 100644 docs/A1099/V2/ErrorResponse.md create mode 100644 docs/A1099/V2/ErrorResponseErrorsInner.md create mode 100644 docs/A1099/V2/Form1099Base.md create mode 100644 docs/A1099/V2/Form1099DivList.md create mode 100644 docs/A1099/V2/Form1099DivListItem.md create mode 100644 docs/A1099/V2/Form1099DivRequest.md create mode 100644 docs/A1099/V2/Form1099K.md create mode 100644 docs/A1099/V2/Form1099KList.md create mode 100644 docs/A1099/V2/Form1099KListItem.md create mode 100644 docs/A1099/V2/Form1099KRequest.md create mode 100644 docs/A1099/V2/Form1099List.md create mode 100644 docs/A1099/V2/Form1099ListDataInner.md create mode 100644 docs/A1099/V2/Form1099Misc.md create mode 100644 docs/A1099/V2/Form1099MiscList.md create mode 100644 docs/A1099/V2/Form1099MiscListItem.md create mode 100644 docs/A1099/V2/Form1099MiscRequest.md create mode 100644 docs/A1099/V2/Form1099Nec.md create mode 100644 docs/A1099/V2/Form1099NecList.md create mode 100644 docs/A1099/V2/Form1099NecListItem.md create mode 100644 docs/A1099/V2/Form1099NecRequest.md create mode 100644 docs/A1099/V2/Form1099ProccessResult.md create mode 100644 docs/A1099/V2/Form1099R.md create mode 100644 docs/A1099/V2/Form1099RList.md create mode 100644 docs/A1099/V2/Form1099RListItem.md create mode 100644 docs/A1099/V2/Form1099RRequest.md create mode 100644 docs/A1099/V2/Form1099StatusDetail.md create mode 100644 docs/A1099/V2/FormRequestBase.md create mode 100644 docs/A1099/V2/FormRequestModel.md create mode 100644 docs/A1099/V2/FormResponseBase.md create mode 100644 docs/A1099/V2/FormSingleRequestBase.md create mode 100644 docs/A1099/V2/Forms1099Api.md create mode 100644 docs/A1099/V2/FormsW9Api.md create mode 100644 docs/A1099/V2/HttpValidationProblemDetails.md create mode 100644 docs/A1099/V2/ICreateForm1099Request.md create mode 100644 docs/A1099/V2/IUpdateForm1099Request.md create mode 100644 docs/A1099/V2/IW9FormDataModelsOneOf.md create mode 100644 docs/A1099/V2/IssuerCommand.md create mode 100644 docs/A1099/V2/IssuerResponse.md create mode 100644 docs/A1099/V2/Issuers1099Api.md create mode 100644 docs/A1099/V2/JobResult.md create mode 100644 docs/A1099/V2/Jobs1099Api.md create mode 100644 docs/A1099/V2/Link.md create mode 100644 docs/A1099/V2/PaginatedQueryResultModel.md create mode 100644 docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md create mode 100644 docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md create mode 100644 docs/A1099/V2/PaginatedW9FormsModel.md create mode 100644 docs/A1099/V2/ProblemDetails.md create mode 100644 docs/A1099/V2/StateAndLocalWithholding.md create mode 100644 docs/A1099/V2/StateAndLocalWithholdingRequest.md create mode 100644 docs/A1099/V2/StateEfileStatusDetail.md create mode 100644 docs/A1099/V2/SubstantialUsOwnerResponse.md create mode 100644 docs/A1099/V2/ValidationError.md create mode 100644 docs/A1099/V2/W4FormDataModel.md create mode 100644 docs/A1099/V2/W4FormResponse.md create mode 100644 docs/A1099/V2/W8BenEFormResponse.md create mode 100644 docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md create mode 100644 docs/A1099/V2/W8BenFormDataModel.md create mode 100644 docs/A1099/V2/W8BenFormResponse.md create mode 100644 docs/A1099/V2/W8BeneFormDataModel.md create mode 100644 docs/A1099/V2/W8ImyFormDataModel.md create mode 100644 docs/A1099/V2/W8ImyFormResponse.md create mode 100644 docs/A1099/V2/W9FormBaseResponse.md create mode 100644 docs/A1099/V2/W9FormDataModel.md create mode 100644 docs/A1099/V2/W9FormResponse.md create mode 100644 docs/EInvoicing/V1/BatchSearchParticipants202Response.md create mode 100644 docs/EInvoicing/V1/EventId.md create mode 100644 docs/EInvoicing/V1/EventMessage.md create mode 100644 docs/EInvoicing/V1/EventPayload.md create mode 100644 docs/EInvoicing/V1/EventSubscription.md create mode 100644 docs/EInvoicing/V1/HmacSignature.md create mode 100644 docs/EInvoicing/V1/HmacSignatureValue.md create mode 100644 docs/EInvoicing/V1/Id.md create mode 100644 docs/EInvoicing/V1/OutputDataFormats.md create mode 100644 docs/EInvoicing/V1/Pagination.md create mode 100644 docs/EInvoicing/V1/Signature.md create mode 100644 docs/EInvoicing/V1/SignatureSignature.md create mode 100644 docs/EInvoicing/V1/SignatureValue.md create mode 100644 docs/EInvoicing/V1/SignatureValueSignature.md create mode 100644 docs/EInvoicing/V1/SubscriptionCommon.md create mode 100644 docs/EInvoicing/V1/SubscriptionDetail.md create mode 100644 docs/EInvoicing/V1/SubscriptionListResponse.md create mode 100644 docs/EInvoicing/V1/SubscriptionRegistration.md create mode 100644 docs/EInvoicing/V1/SubscriptionsApi.md create mode 100644 docs/EInvoicing/V1/SuccessResponse.md create mode 100644 docs/EInvoicing/V1/WebhookInvocation.md create mode 100644 docs/EInvoicing/V1/WebhooksErrorInfo.md create mode 100644 docs/EInvoicing/V1/WebhooksErrorResponse.md create mode 100644 lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb create mode 100644 lib/avalara_sdk/api/A1099/V2/forms1099_api.rb create mode 100644 lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb create mode 100644 lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb create mode 100644 lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb create mode 100644 lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/attribute.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/base_company_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/company_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/company_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/company_response_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/data.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/error_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/error_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_base.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_k.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_list.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_list_data_inner.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_misc.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_nec.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_r.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form1099_status_detail.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form_request_base.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form_request_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form_response_base.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/issuer_command.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/issuer_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/job_result.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/link.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/problem_details.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/state_and_local_withholding.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/state_efile_status_detail.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/validation_error.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w4_form_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb create mode 100644 lib/avalara_sdk/models/A1099/V2/w9_form_response.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/batch_search_participants202_response.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/event_id.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/event_message.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/event_payload.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/event_subscription.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/hmac_signature.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/id.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/output_data_formats.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/pagination.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/signature.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/signature_signature.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/signature_value_signature.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/subscription_detail.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/subscription_list_response.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/subscription_registration.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/success_response.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/webhook_invocation.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_info.rb create mode 100644 lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb delete mode 100644 spec/api_client_spec.rb diff --git a/Gemfile b/Gemfile index dc3a2b4..acc2b46 100644 --- a/Gemfile +++ b/Gemfile @@ -5,8 +5,8 @@ gemspec group :development, :test do gem 'rake', '~> 13.0.1' gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' + gem 'rubocop', '~> 1.50' gem 'ruby-debug-ide' - gem 'debase', '~> 0.2.5.beta2' + gem 'debug' gem 'dotenv' end diff --git a/Gemfile.lock b/Gemfile.lock index bffb885..3be8589 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,14 +7,16 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) byebug (11.1.3) coderay (1.1.3) - debase (0.2.5.beta2) - debase-ruby_core_source (>= 0.10.12) - debase-ruby_core_source (0.10.16) + date (3.4.1) + debug (1.10.0) + irb (~> 1.10) + reline (>= 0.3.8) diff-lcs (1.5.0) dotenv (2.7.6) + erb (5.0.1) faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -38,22 +40,42 @@ GEM faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - jaro_winkler (1.5.4) + io-console (0.8.0) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.12.2) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) method_source (1.0.0) multipart-post (2.4.1) - parallel (1.22.1) - parser (3.1.2.0) + parallel (1.27.0) + parser (3.3.8.0) ast (~> 2.4.1) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + prism (1.4.0) pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.9.0) byebug (~> 11.0) pry (~> 0.13.0) - psych (4.0.4) + psych (5.2.6) + date stringio + racc (1.8.1) rainbow (3.1.1) rake (13.0.6) + rdoc (6.14.0) + erb + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.1) + io-console (~> 0.5) rspec (3.11.0) rspec-core (~> 3.11.0) rspec-expectations (~> 3.11.0) @@ -67,35 +89,44 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-support (3.11.0) - rubocop (0.66.0) - jaro_winkler (~> 1.5.1) + rubocop (1.76.1) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) - psych (>= 3.1.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.45.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.6) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.45.1) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-debug-ide (0.7.3) rake (>= 0.8.1) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - stringio (3.0.2) - unicode-display_width (1.5.0) + stringio (3.1.7) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) PLATFORMS arm64-darwin-22 + arm64-darwin-24 x64-mingw32 x86_64-darwin-20 x86_64-linux DEPENDENCIES avalara_sdk! - debase (~> 0.2.5.beta2) + debug dotenv pry-byebug rake (~> 13.0.1) rspec (~> 3.6, >= 3.6.0) - rubocop (~> 0.66.0) + rubocop (~> 1.50) ruby-debug-ide BUNDLED WITH diff --git a/README.md b/README.md index f6e0520..8e42ba5 100644 --- a/README.md +++ b/README.md @@ -41,74 +41,205 @@ end ``` - ## Documentation for API Endpoints - ### EInvoicing V1 API Documentation -| Class | Method | HTTP request | Description | -| -------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| _DataInputFieldsApi_ | [**get_data_input_fields**](docs/EInvoicing/V1/DataInputFieldsApi.md#get_data_input_fields) | **GET** /data-input-fields | Returns the optionality of document fields for different country mandates | -| _DocumentsApi_ | [**download_document**](docs/EInvoicing/V1/DocumentsApi.md#download_document) | **GET** /documents/{documentId}/$download | Returns a copy of the document | -| _DocumentsApi_ | [**fetch_documents**](docs/EInvoicing/V1/DocumentsApi.md#fetch_documents) | **POST** /documents/$fetch | Fetch the inbound document from a tax authority | -| _DocumentsApi_ | [**get_document_list**](docs/EInvoicing/V1/DocumentsApi.md#get_document_list) | **GET** /documents | Returns a summary of documents for a date range | -| _DocumentsApi_ | [**get_document_status**](docs/EInvoicing/V1/DocumentsApi.md#get_document_status) | **GET** /documents/{documentId}/status | Checks the status of a document | -| _DocumentsApi_ | [**submit_document**](docs/EInvoicing/V1/DocumentsApi.md#submit_document) | **POST** /documents | Submits a document to Avalara E-Invoicing API | -| _InteropApi_ | [**submit_interop_document**](docs/EInvoicing/V1/InteropApi.md#submit_interop_document) | **POST** /interop/documents | Submit a document | -| _MandatesApi_ | [**get_mandate_data_input_fields**](docs/EInvoicing/V1/MandatesApi.md#get_mandate_data_input_fields) | **GET** /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version | -| _MandatesApi_ | [**get_mandates**](docs/EInvoicing/V1/MandatesApi.md#get_mandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform | -| _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. | -| _TradingPartnersApi_ | [**search_participants**](docs/EInvoicing/V1/TradingPartnersApi.md#search_participants) | **GET** /trading-partners | Returns a list of participants matching the input query. | +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DataInputFieldsApi* | [**get_data_input_fields**](docs/EInvoicing/V1/DataInputFieldsApi.md#get_data_input_fields) | **GET** /data-input-fields | Returns the optionality of document fields for different country mandates +*DocumentsApi* | [**download_document**](docs/EInvoicing/V1/DocumentsApi.md#download_document) | **GET** /documents/{documentId}/$download | Returns a copy of the document +*DocumentsApi* | [**fetch_documents**](docs/EInvoicing/V1/DocumentsApi.md#fetch_documents) | **POST** /documents/$fetch | Fetch the inbound document from a tax authority +*DocumentsApi* | [**get_document_list**](docs/EInvoicing/V1/DocumentsApi.md#get_document_list) | **GET** /documents | Returns a summary of documents for a date range +*DocumentsApi* | [**get_document_status**](docs/EInvoicing/V1/DocumentsApi.md#get_document_status) | **GET** /documents/{documentId}/status | Checks the status of a document +*DocumentsApi* | [**submit_document**](docs/EInvoicing/V1/DocumentsApi.md#submit_document) | **POST** /documents | Submits a document to Avalara E-Invoicing API +*InteropApi* | [**submit_interop_document**](docs/EInvoicing/V1/InteropApi.md#submit_interop_document) | **POST** /interop/documents | Submit a document +*MandatesApi* | [**get_mandate_data_input_fields**](docs/EInvoicing/V1/MandatesApi.md#get_mandate_data_input_fields) | **GET** /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version +*MandatesApi* | [**get_mandates**](docs/EInvoicing/V1/MandatesApi.md#get_mandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform +*SubscriptionsApi* | [**create_webhook_subscription**](docs/EInvoicing/V1/SubscriptionsApi.md#create_webhook_subscription) | **POST** /webhooks/subscriptions | Create a subscription to events +*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. +*TradingPartnersApi* | [**search_participants**](docs/EInvoicing/V1/TradingPartnersApi.md#search_participants) | **GET** /trading-partners | Returns a list of participants matching the input query. + + +### 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* | [**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. +*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* | [**get_w9_form**](docs/A1099/V2/FormsW9Api.md#get_w9_form) | **GET** /w9/forms/{id} | Retrieve a W9/W4/W8 form +*FormsW9Api* | [**get_w9_form_request**](docs/A1099/V2/FormsW9Api.md#get_w9_form_request) | **GET** /w9/forms/requests/{formRequestId} | Retrieve a form request +*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* | [**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 +*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_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 - ## Documentation for Models - ### EInvoicing V1 Model Documentation -- [models.BadDownloadRequest](docs/EInvoicing/V1/BadDownloadRequest.md) -- [models.BadRequest](docs/EInvoicing/V1/BadRequest.md) -- [models.BatchSearch](docs/EInvoicing/V1/BatchSearch.md) -- [models.BatchSearchListResponse](docs/EInvoicing/V1/BatchSearchListResponse.md) -- [models.ConditionalForField](docs/EInvoicing/V1/ConditionalForField.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.DocumentFetchRequest](docs/EInvoicing/V1/DocumentFetchRequest.md) -- [models.DocumentFetchRequestDataInner](docs/EInvoicing/V1/DocumentFetchRequestDataInner.md) -- [models.DocumentFetchRequestMetadata](docs/EInvoicing/V1/DocumentFetchRequestMetadata.md) -- [models.DocumentListResponse](docs/EInvoicing/V1/DocumentListResponse.md) -- [models.DocumentStatusResponse](docs/EInvoicing/V1/DocumentStatusResponse.md) -- [models.DocumentSubmissionError](docs/EInvoicing/V1/DocumentSubmissionError.md) -- [models.DocumentSubmitResponse](docs/EInvoicing/V1/DocumentSubmitResponse.md) -- [models.DocumentSummary](docs/EInvoicing/V1/DocumentSummary.md) -- [models.ErrorResponse](docs/EInvoicing/V1/ErrorResponse.md) -- [models.ForbiddenError](docs/EInvoicing/V1/ForbiddenError.md) -- [models.InputDataFormats](docs/EInvoicing/V1/InputDataFormats.md) -- [models.InternalServerError](docs/EInvoicing/V1/InternalServerError.md) -- [models.Mandate](docs/EInvoicing/V1/Mandate.md) -- [models.MandateDataInputField](docs/EInvoicing/V1/MandateDataInputField.md) -- [models.MandateDataInputFieldNamespace](docs/EInvoicing/V1/MandateDataInputFieldNamespace.md) -- [models.MandatesResponse](docs/EInvoicing/V1/MandatesResponse.md) -- [models.NotFoundError](docs/EInvoicing/V1/NotFoundError.md) -- [models.NotUsedForField](docs/EInvoicing/V1/NotUsedForField.md) -- [models.RequiredWhenField](docs/EInvoicing/V1/RequiredWhenField.md) -- [models.StatusEvent](docs/EInvoicing/V1/StatusEvent.md) -- [models.SubmitDocumentMetadata](docs/EInvoicing/V1/SubmitDocumentMetadata.md) -- [models.SubmitInteropDocument202Response](docs/EInvoicing/V1/SubmitInteropDocument202Response.md) -- [models.WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md) + - [models.BadDownloadRequest](docs/EInvoicing/V1/BadDownloadRequest.md) + - [models.BadRequest](docs/EInvoicing/V1/BadRequest.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.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) + - [models.DocumentSubmissionError](docs/EInvoicing/V1/DocumentSubmissionError.md) + - [models.DocumentSubmitResponse](docs/EInvoicing/V1/DocumentSubmitResponse.md) + - [models.DocumentSummary](docs/EInvoicing/V1/DocumentSummary.md) + - [models.ErrorResponse](docs/EInvoicing/V1/ErrorResponse.md) + - [models.EventId](docs/EInvoicing/V1/EventId.md) + - [models.EventMessage](docs/EInvoicing/V1/EventMessage.md) + - [models.EventPayload](docs/EInvoicing/V1/EventPayload.md) + - [models.EventSubscription](docs/EInvoicing/V1/EventSubscription.md) + - [models.FetchDocumentsRequest](docs/EInvoicing/V1/FetchDocumentsRequest.md) + - [models.FetchDocumentsRequestDataInner](docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md) + - [models.FetchDocumentsRequestMetadata](docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md) + - [models.ForbiddenError](docs/EInvoicing/V1/ForbiddenError.md) + - [models.HmacSignature](docs/EInvoicing/V1/HmacSignature.md) + - [models.HmacSignatureValue](docs/EInvoicing/V1/HmacSignatureValue.md) + - [models.Id](docs/EInvoicing/V1/Id.md) + - [models.InputDataFormats](docs/EInvoicing/V1/InputDataFormats.md) + - [models.InternalServerError](docs/EInvoicing/V1/InternalServerError.md) + - [models.Mandate](docs/EInvoicing/V1/Mandate.md) + - [models.MandateDataInputField](docs/EInvoicing/V1/MandateDataInputField.md) + - [models.MandateDataInputFieldNamespace](docs/EInvoicing/V1/MandateDataInputFieldNamespace.md) + - [models.MandatesResponse](docs/EInvoicing/V1/MandatesResponse.md) + - [models.NotFoundError](docs/EInvoicing/V1/NotFoundError.md) + - [models.NotUsedForField](docs/EInvoicing/V1/NotUsedForField.md) + - [models.OutputDataFormats](docs/EInvoicing/V1/OutputDataFormats.md) + - [models.Pagination](docs/EInvoicing/V1/Pagination.md) + - [models.RequiredWhenField](docs/EInvoicing/V1/RequiredWhenField.md) + - [models.Signature](docs/EInvoicing/V1/Signature.md) + - [models.SignatureSignature](docs/EInvoicing/V1/SignatureSignature.md) + - [models.SignatureValue](docs/EInvoicing/V1/SignatureValue.md) + - [models.SignatureValueSignature](docs/EInvoicing/V1/SignatureValueSignature.md) + - [models.StatusEvent](docs/EInvoicing/V1/StatusEvent.md) + - [models.SubmitDocumentMetadata](docs/EInvoicing/V1/SubmitDocumentMetadata.md) + - [models.SubmitInteropDocument202Response](docs/EInvoicing/V1/SubmitInteropDocument202Response.md) + - [models.SubscriptionCommon](docs/EInvoicing/V1/SubscriptionCommon.md) + - [models.SubscriptionDetail](docs/EInvoicing/V1/SubscriptionDetail.md) + - [models.SubscriptionListResponse](docs/EInvoicing/V1/SubscriptionListResponse.md) + - [models.SubscriptionRegistration](docs/EInvoicing/V1/SubscriptionRegistration.md) + - [models.SuccessResponse](docs/EInvoicing/V1/SuccessResponse.md) + - [models.WebhookInvocation](docs/EInvoicing/V1/WebhookInvocation.md) + - [models.WebhooksErrorInfo](docs/EInvoicing/V1/WebhooksErrorInfo.md) + - [models.WebhooksErrorResponse](docs/EInvoicing/V1/WebhooksErrorResponse.md) + - [models.WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md) + + + +### A1099 V2 Model Documentation + + - [models.Attribute](docs/A1099/V2/Attribute.md) + - [models.AuthorizedApiRequestModel](docs/A1099/V2/AuthorizedApiRequestModel.md) + - [models.AuthorizedApiRequestV2DataModel](docs/A1099/V2/AuthorizedApiRequestV2DataModel.md) + - [models.BaseCompanyModel](docs/A1099/V2/BaseCompanyModel.md) + - [models.BaseFormListRequest](docs/A1099/V2/BaseFormListRequest.md) + - [models.BulkUpsert1099FormsRequest](docs/A1099/V2/BulkUpsert1099FormsRequest.md) + - [models.CompanyCreateUpdateRequestModel](docs/A1099/V2/CompanyCreateUpdateRequestModel.md) + - [models.CompanyModel](docs/A1099/V2/CompanyModel.md) + - [models.CompanyResponse](docs/A1099/V2/CompanyResponse.md) + - [models.CompanyResponseModel](docs/A1099/V2/CompanyResponseModel.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.Form1099Base](docs/A1099/V2/Form1099Base.md) + - [models.Form1099DivList](docs/A1099/V2/Form1099DivList.md) + - [models.Form1099DivListItem](docs/A1099/V2/Form1099DivListItem.md) + - [models.Form1099DivRequest](docs/A1099/V2/Form1099DivRequest.md) + - [models.Form1099K](docs/A1099/V2/Form1099K.md) + - [models.Form1099KList](docs/A1099/V2/Form1099KList.md) + - [models.Form1099KListItem](docs/A1099/V2/Form1099KListItem.md) + - [models.Form1099KRequest](docs/A1099/V2/Form1099KRequest.md) + - [models.Form1099List](docs/A1099/V2/Form1099List.md) + - [models.Form1099ListDataInner](docs/A1099/V2/Form1099ListDataInner.md) + - [models.Form1099Misc](docs/A1099/V2/Form1099Misc.md) + - [models.Form1099MiscList](docs/A1099/V2/Form1099MiscList.md) + - [models.Form1099MiscListItem](docs/A1099/V2/Form1099MiscListItem.md) + - [models.Form1099MiscRequest](docs/A1099/V2/Form1099MiscRequest.md) + - [models.Form1099Nec](docs/A1099/V2/Form1099Nec.md) + - [models.Form1099NecList](docs/A1099/V2/Form1099NecList.md) + - [models.Form1099NecListItem](docs/A1099/V2/Form1099NecListItem.md) + - [models.Form1099NecRequest](docs/A1099/V2/Form1099NecRequest.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.Form1099RRequest](docs/A1099/V2/Form1099RRequest.md) + - [models.Form1099StatusDetail](docs/A1099/V2/Form1099StatusDetail.md) + - [models.FormRequestBase](docs/A1099/V2/FormRequestBase.md) + - [models.FormRequestModel](docs/A1099/V2/FormRequestModel.md) + - [models.FormResponseBase](docs/A1099/V2/FormResponseBase.md) + - [models.FormSingleRequestBase](docs/A1099/V2/FormSingleRequestBase.md) + - [models.HttpValidationProblemDetails](docs/A1099/V2/HttpValidationProblemDetails.md) + - [models.ICreateForm1099Request](docs/A1099/V2/ICreateForm1099Request.md) + - [models.IUpdateForm1099Request](docs/A1099/V2/IUpdateForm1099Request.md) + - [models.IW9FormDataModelsOneOf](docs/A1099/V2/IW9FormDataModelsOneOf.md) + - [models.IssuerCommand](docs/A1099/V2/IssuerCommand.md) + - [models.IssuerResponse](docs/A1099/V2/IssuerResponse.md) + - [models.JobResult](docs/A1099/V2/JobResult.md) + - [models.Link](docs/A1099/V2/Link.md) + - [models.PaginatedQueryResultModel](docs/A1099/V2/PaginatedQueryResultModel.md) + - [models.PaginatedQueryResultModelCompanyResponse](docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md) + - [models.PaginatedQueryResultModelIssuerResponse](docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md) + - [models.PaginatedW9FormsModel](docs/A1099/V2/PaginatedW9FormsModel.md) + - [models.ProblemDetails](docs/A1099/V2/ProblemDetails.md) + - [models.StateAndLocalWithholding](docs/A1099/V2/StateAndLocalWithholding.md) + - [models.StateAndLocalWithholdingRequest](docs/A1099/V2/StateAndLocalWithholdingRequest.md) + - [models.StateEfileStatusDetail](docs/A1099/V2/StateEfileStatusDetail.md) + - [models.SubstantialUsOwnerResponse](docs/A1099/V2/SubstantialUsOwnerResponse.md) + - [models.ValidationError](docs/A1099/V2/ValidationError.md) + - [models.W4FormDataModel](docs/A1099/V2/W4FormDataModel.md) + - [models.W4FormResponse](docs/A1099/V2/W4FormResponse.md) + - [models.W8BenEFormResponse](docs/A1099/V2/W8BenEFormResponse.md) + - [models.W8BenESubstantialUsOwnerDataModel](docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md) + - [models.W8BenFormDataModel](docs/A1099/V2/W8BenFormDataModel.md) + - [models.W8BenFormResponse](docs/A1099/V2/W8BenFormResponse.md) + - [models.W8BeneFormDataModel](docs/A1099/V2/W8BeneFormDataModel.md) + - [models.W8ImyFormDataModel](docs/A1099/V2/W8ImyFormDataModel.md) + - [models.W8ImyFormResponse](docs/A1099/V2/W8ImyFormResponse.md) + - [models.W9FormBaseResponse](docs/A1099/V2/W9FormBaseResponse.md) + - [models.W9FormDataModel](docs/A1099/V2/W9FormDataModel.md) + - [models.W9FormResponse](docs/A1099/V2/W9FormResponse.md) diff --git a/docs/A1099/V2/Attribute.md b/docs/A1099/V2/Attribute.md new file mode 100644 index 0000000..6896a85 --- /dev/null +++ b/docs/A1099/V2/Attribute.md @@ -0,0 +1,48 @@ +# AvalaraSdk::A1099::V2::Attribute + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **dry_run** | **Boolean** | | [optional] | +| **upsert** | **Boolean** | | [optional] | +| **status** | **String** | | [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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Attribute.new( + dry_run: null, + upsert: null, + status: InProgress, + error_message: null, + total_processed: null, + total_rows: null, + updated_valid: null, + updated_no_email: null, + updated_invalid: null, + skipped_duplicate: null, + skipped_invalid: null, + skipped_multiple_matches: null, + not_found: null, + created_invalid: null, + created_no_email: null, + created_valid: null +) +``` + diff --git a/docs/A1099/V2/AuthorizedApiRequestModel.md b/docs/A1099/V2/AuthorizedApiRequestModel.md new file mode 100644 index 0000000..1f9e3d0 --- /dev/null +++ b/docs/A1099/V2/AuthorizedApiRequestModel.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::AuthorizedApiRequestModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **path** | **String** | The path and query of the API request you want to pre-authorize, omitting the leading /api/ | [optional] | +| **ttl** | **Integer** | Seconds until this AuthorizedApiRequest should expire, 3600 if omitted; values greater than 86400 will not be honored | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::AuthorizedApiRequestModel.new( + path: form-pdf?filter[form_type_eq]=1099-NEC&filter[reference_id_eq]=SE-02453450&filter[tax_year_eq]=2023, + ttl: 3600 +) +``` + diff --git a/docs/A1099/V2/AuthorizedApiRequestV2DataModel.md b/docs/A1099/V2/AuthorizedApiRequestV2DataModel.md new file mode 100644 index 0000000..cecb51c --- /dev/null +++ b/docs/A1099/V2/AuthorizedApiRequestV2DataModel.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::AuthorizedApiRequestV2DataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **path** | **String** | | [optional] | +| **expires_at** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::AuthorizedApiRequestV2DataModel.new( + id: d0d09a2f-619e-4e9d-aae4-3311d9e0c67c, + path: form-pdf?filter[form_type_eq]=1099-NEC&filter[reference_id_eq]=SE-02453450&filter[tax_year_eq]=2024, + expires_at: 2022-04-29T15:19:42.995-04:00 +) +``` + diff --git a/docs/A1099/V2/BaseCompanyModel.md b/docs/A1099/V2/BaseCompanyModel.md new file mode 100644 index 0000000..66cc6df --- /dev/null +++ b/docs/A1099/V2/BaseCompanyModel.md @@ -0,0 +1,50 @@ +# AvalaraSdk::A1099::V2::BaseCompanyModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **telephone** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **dba_name** | **String** | | [optional] | +| **reference_id** | **String** | | [optional] | +| **do_tin_match** | **Boolean** | | [optional] | +| **group_name** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **resend_requests** | **Boolean** | | [optional] | +| **resend_interval_days** | **Integer** | | [optional] | +| **max_reminder_attempts** | **Integer** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::BaseCompanyModel.new( + name: null, + email: null, + address: null, + city: null, + state: null, + zip: null, + telephone: null, + tin: null, + dba_name: null, + reference_id: null, + do_tin_match: null, + group_name: null, + foreign_province: null, + country_code: null, + resend_requests: null, + resend_interval_days: null, + max_reminder_attempts: null +) +``` + diff --git a/docs/A1099/V2/BaseFormListRequest.md b/docs/A1099/V2/BaseFormListRequest.md new file mode 100644 index 0000000..3b60ac3 --- /dev/null +++ b/docs/A1099/V2/BaseFormListRequest.md @@ -0,0 +1,18 @@ +# AvalaraSdk::A1099::V2::BaseFormListRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::BaseFormListRequest.new( + form_type: null +) +``` + diff --git a/docs/A1099/V2/BulkUpsert1099FormsRequest.md b/docs/A1099/V2/BulkUpsert1099FormsRequest.md new file mode 100644 index 0000000..df2e83c --- /dev/null +++ b/docs/A1099/V2/BulkUpsert1099FormsRequest.md @@ -0,0 +1,55 @@ +# AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest.openapi_one_of +# => +# [ +# :'Form1099DivList', +# :'Form1099KList', +# :'Form1099MiscList', +# :'Form1099NecList', +# :'Form1099RList' +# ] +``` + +### 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::BulkUpsert1099FormsRequest.build(data) +# => # + +AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Form1099DivList` +- `Form1099KList` +- `Form1099MiscList` +- `Form1099NecList` +- `Form1099RList` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/CompaniesW9Api.md b/docs/A1099/V2/CompaniesW9Api.md new file mode 100644 index 0000000..f6185c7 --- /dev/null +++ b/docs/A1099/V2/CompaniesW9Api.md @@ -0,0 +1,424 @@ +# AvalaraSdk::A1099::V2::CompaniesW9Api + +All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* + +| 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 | +| [**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 | + + +## create_company + +> create_company(avalara_version, x_correlation_id, opts) + +Creates a new company + +Creates a new company + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::CompaniesW9Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = 'c66e3323-aa87-424c-9c89-8dfee7bfe206' # String | Unique correlation Id in a GUID format +opts = { + company_create_update_request_model: AvalaraSdk::A1099::V2::CompanyCreateUpdateRequestModel.new # CompanyCreateUpdateRequestModel | The company to create +} + +begin + # Creates a new company + result = api_instance.create_company(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling CompaniesW9Api->create_company: #{e}" +end +``` + +#### Using the create_company_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_company_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # Creates a new company + data, status_code, headers = api_instance.create_company_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling CompaniesW9Api->create_company_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **company_create_update_request_model** | [**CompanyCreateUpdateRequestModel**](CompanyCreateUpdateRequestModel.md) | The company to create | [optional] | + +### Return type + +[**CompanyResponseModel**](CompanyResponseModel.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +## delete_company + +> delete_company(id, avalara_version, x_correlation_id) + +Deletes a company + +Deletes a company + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::CompaniesW9Api.new api_client + +id = 'id_example' # String | The company to delete +avalara_version = '2.0' # String | API version +x_correlation_id = '59295e97-31e8-49fc-93e1-e012007ebdde' # String | Unique correlation Id in a GUID format + +begin + # Deletes a company + api_instance.delete_company(id, avalara_version, x_correlation_id) +rescue AvalaraSdk::ApiError => e + puts "Error when calling CompaniesW9Api->delete_company: #{e}" +end +``` + +#### Using the delete_company_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_company_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Deletes a company + data, status_code, headers = api_instance.delete_company_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling CompaniesW9Api->delete_company_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The company to delete | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +nil (empty response body) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_companies + +> get_companies(avalara_version, x_correlation_id, opts) + +List companies + +List existing companies. Filterable/Sortable fields are: \"name\", \"referenceId\", \"group.name\", \"createdAt\" and \"updatedAt\". + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::CompaniesW9Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = '18ba9c2b-136f-4365-a847-92af92dfe7ba' # String | Unique correlation Id in a GUID format +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. + 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 | 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. +} + +begin + # List companies + result = api_instance.get_companies(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling CompaniesW9Api->get_companies: #{e}" +end +``` + +#### Using the get_companies_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_companies_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # List companies + data, status_code, headers = api_instance.get_companies_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling CompaniesW9Api->get_companies_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **filter** | **String** | A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. | [optional] | +| **top** | **Integer** | If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. | [optional] | +| **skip** | **Integer** | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. | [optional] | +| **order_by** | **String** | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. | [optional] | +| **count** | **Boolean** | If true, return the global count of elements in the collection. | [optional] | +| **count_only** | **Boolean** | If true, return ONLY the global count of elements in the collection. It only applies when count=true. | [optional] | + +### Return type + +[**PaginatedQueryResultModelCompanyResponse**](PaginatedQueryResultModelCompanyResponse.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_company + +> get_company(id, avalara_version, x_correlation_id) + +Retrieve a company + +Retrieve an existing company + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::CompaniesW9Api.new api_client + +id = 'id_example' # String | Id of the company +avalara_version = '2.0' # String | API version +x_correlation_id = 'b378b193-3da6-4dce-87ee-e2ad780e1ed3' # String | Unique correlation Id in a GUID format + +begin + # Retrieve a company + result = api_instance.get_company(id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling CompaniesW9Api->get_company: #{e}" +end +``` + +#### Using the get_company_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_company_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Retrieve a company + data, status_code, headers = api_instance.get_company_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling CompaniesW9Api->get_company_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the company | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**CompanyResponse**](CompanyResponse.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_company + +> update_company(id, avalara_version, x_correlation_id, opts) + +Update a company + +Update a company + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::CompaniesW9Api.new api_client + +id = 'id_example' # String | The ID of the company to update +avalara_version = '2.0' # String | API version +x_correlation_id = 'ef982351-7c46-4d85-a211-672e1a62f221' # String | Unique correlation Id in a GUID format +opts = { + company_create_update_request_model: AvalaraSdk::A1099::V2::CompanyCreateUpdateRequestModel.new # CompanyCreateUpdateRequestModel | The updated company data +} + +begin + # Update a company + result = api_instance.update_company(id, avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling CompaniesW9Api->update_company: #{e}" +end +``` + +#### Using the update_company_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_company_with_http_info(id, avalara_version, x_correlation_id, opts) + +```ruby +begin + # Update a company + data, status_code, headers = api_instance.update_company_with_http_info(id, avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling CompaniesW9Api->update_company_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The ID of the company to update | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **company_create_update_request_model** | [**CompanyCreateUpdateRequestModel**](CompanyCreateUpdateRequestModel.md) | The updated company data | [optional] | + +### Return type + +[**CompanyResponseModel**](CompanyResponseModel.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + diff --git a/docs/A1099/V2/CompanyCreateUpdateRequestModel.md b/docs/A1099/V2/CompanyCreateUpdateRequestModel.md new file mode 100644 index 0000000..174063a --- /dev/null +++ b/docs/A1099/V2/CompanyCreateUpdateRequestModel.md @@ -0,0 +1,50 @@ +# AvalaraSdk::A1099::V2::CompanyCreateUpdateRequestModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **telephone** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **dba_name** | **String** | | [optional] | +| **reference_id** | **String** | | [optional] | +| **do_tin_match** | **Boolean** | | [optional] | +| **group_name** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **resend_requests** | **Boolean** | | [optional] | +| **resend_interval_days** | **Integer** | | [optional] | +| **max_reminder_attempts** | **Integer** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::CompanyCreateUpdateRequestModel.new( + name: null, + email: null, + address: null, + city: null, + state: null, + zip: null, + telephone: null, + tin: null, + dba_name: null, + reference_id: null, + do_tin_match: null, + group_name: null, + foreign_province: null, + country_code: null, + resend_requests: null, + resend_interval_days: null, + max_reminder_attempts: null +) +``` + diff --git a/docs/A1099/V2/CompanyModel.md b/docs/A1099/V2/CompanyModel.md new file mode 100644 index 0000000..0113920 --- /dev/null +++ b/docs/A1099/V2/CompanyModel.md @@ -0,0 +1,60 @@ +# AvalaraSdk::A1099::V2::CompanyModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Company ID | [optional] | +| **user_id** | **Integer** | User ID associated with the company | [optional] | +| **account_id** | **Integer** | Account ID associated with the company | [optional] | +| **created_at** | **Time** | Record creation timestamp | [optional] | +| **updated_at** | **Time** | Record last update timestamp | [optional] | +| **name** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **telephone** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **dba_name** | **String** | | [optional] | +| **reference_id** | **String** | | [optional] | +| **do_tin_match** | **Boolean** | | [optional] | +| **group_name** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **resend_requests** | **Boolean** | | [optional] | +| **resend_interval_days** | **Integer** | | [optional] | +| **max_reminder_attempts** | **Integer** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::CompanyModel.new( + id: , + user_id: 0, + account_id: 0, + created_at: null, + updated_at: null, + name: null, + email: null, + address: null, + city: null, + state: null, + zip: null, + telephone: null, + tin: null, + dba_name: null, + reference_id: null, + do_tin_match: null, + group_name: null, + foreign_province: null, + country_code: null, + resend_requests: null, + resend_interval_days: null, + max_reminder_attempts: null +) +``` + diff --git a/docs/A1099/V2/CompanyResponse.md b/docs/A1099/V2/CompanyResponse.md new file mode 100644 index 0000000..e00758d --- /dev/null +++ b/docs/A1099/V2/CompanyResponse.md @@ -0,0 +1,56 @@ +# AvalaraSdk::A1099::V2::CompanyResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **reference_id** | **String** | | [optional] | +| **group_name** | **String** | | [optional] | +| **name** | **String** | | [optional] | +| **dba_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **telephone** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **do_tin_match** | **Boolean** | | [optional] | +| **resend_requests** | **Boolean** | | [optional] | +| **resend_interval_days** | **Integer** | | [optional] | +| **max_reminder_attempts** | **Integer** | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::CompanyResponse.new( + id: , + reference_id: , + group_name: , + name: , + dba_name: , + address: , + city: , + state: , + foreign_province: , + zip: , + country_code: , + email: , + telephone: , + tin: , + do_tin_match: null, + resend_requests: null, + resend_interval_days: null, + max_reminder_attempts: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/CompanyResponseModel.md b/docs/A1099/V2/CompanyResponseModel.md new file mode 100644 index 0000000..86e9da1 --- /dev/null +++ b/docs/A1099/V2/CompanyResponseModel.md @@ -0,0 +1,56 @@ +# AvalaraSdk::A1099::V2::CompanyResponseModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **name** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **telephone** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **dba_name** | **String** | | [optional] | +| **reference_id** | **String** | | [optional] | +| **do_tin_match** | **Boolean** | | [optional] | +| **group_name** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **resend_requests** | **Boolean** | | [optional] | +| **resend_interval_days** | **Integer** | | [optional] | +| **max_reminder_attempts** | **Integer** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::CompanyResponseModel.new( + id: , + created_at: null, + updated_at: null, + name: null, + email: null, + address: null, + city: null, + state: null, + zip: null, + telephone: null, + tin: null, + dba_name: null, + reference_id: null, + do_tin_match: null, + group_name: null, + foreign_province: null, + country_code: null, + resend_requests: null, + resend_interval_days: null, + max_reminder_attempts: null +) +``` + diff --git a/docs/A1099/V2/Data.md b/docs/A1099/V2/Data.md new file mode 100644 index 0000000..b56bf79 --- /dev/null +++ b/docs/A1099/V2/Data.md @@ -0,0 +1,24 @@ +# AvalaraSdk::A1099::V2::Data + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **attributes** | [**Attribute**](Attribute.md) | | [optional] | +| **links** | [**Link**](Link.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Data.new( + id: null, + type: null, + attributes: null, + links: null +) +``` + diff --git a/docs/A1099/V2/ErrorModel.md b/docs/A1099/V2/ErrorModel.md new file mode 100644 index 0000000..a3e6f7e --- /dev/null +++ b/docs/A1099/V2/ErrorModel.md @@ -0,0 +1,28 @@ +# AvalaraSdk::A1099::V2::ErrorModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | HTTP error code in 4xx or 5xx. | [optional] | +| **status** | **String** | HTTP error code in 4xx or 5xx. | [optional] | +| **title** | **String** | Description of the HTTP error code. | [optional] | +| **detail** | **String** | Detailed error message. | [optional] | +| **instance** | **String** | Error code. | [optional] | +| **source** | **Object** | Cause of error. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::ErrorModel.new( + type: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400, + status: 400, + title: Bad request, + detail: , + instance: /issuers/12345, + source: +) +``` + diff --git a/docs/A1099/V2/ErrorResponse.md b/docs/A1099/V2/ErrorResponse.md new file mode 100644 index 0000000..9b02c61 --- /dev/null +++ b/docs/A1099/V2/ErrorResponse.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::ErrorResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | | [optional] | +| **errors** | [**Array<ErrorResponseErrorsInner>**](ErrorResponseErrorsInner.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::ErrorResponse.new( + title: null, + errors: null +) +``` + diff --git a/docs/A1099/V2/ErrorResponseErrorsInner.md b/docs/A1099/V2/ErrorResponseErrorsInner.md new file mode 100644 index 0000000..b2c81bd --- /dev/null +++ b/docs/A1099/V2/ErrorResponseErrorsInner.md @@ -0,0 +1,49 @@ +# AvalaraSdk::A1099::V2::ErrorResponseErrorsInner + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::ErrorResponseErrorsInner.openapi_one_of +# => +# [ +# :'HttpValidationProblemDetails', +# :'ProblemDetails' +# ] +``` + +### 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::ErrorResponseErrorsInner.build(data) +# => # + +AvalaraSdk::A1099::V2::ErrorResponseErrorsInner.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `HttpValidationProblemDetails` +- `ProblemDetails` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/Form1099Base.md b/docs/A1099/V2/Form1099Base.md new file mode 100644 index 0000000..e838d5c --- /dev/null +++ b/docs/A1099/V2/Form1099Base.md @@ -0,0 +1,82 @@ +# AvalaraSdk::A1099::V2::Form1099Base + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **Integer** | | [optional] | +| **issuer_reference_id** | **String** | | [optional] | +| **issuer_tin** | **String** | | [optional] | +| **tax_year** | **Integer** | | [optional] | +| **federal_efile** | **Boolean** | | [optional] | +| **federal_efile_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **state_efile** | **Boolean** | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | +| **postal_mail** | **Boolean** | | [optional] | +| **postal_mail_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **tin_match** | **Boolean** | | [optional] | +| **tin_match_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **address_verification** | **Boolean** | | [optional] | +| **address_verification_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **reference_id** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **type_of_tin** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **first_payee_name** | **String** | | [optional] | +| **second_payee_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **address_recipient_second** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **validation_errors** | [**Array<ValidationError>**](ValidationError.md) | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099Base.new( + id: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + federal_efile: null, + federal_efile_status: null, + state_efile: null, + state_efile_status: null, + postal_mail: null, + postal_mail_status: null, + tin_match: null, + tin_match_status: null, + address_verification: null, + address_verification_status: null, + reference_id: null, + email: null, + type_of_tin: null, + tin: null, + first_payee_name: null, + second_payee_name: null, + address: null, + address_recipient_second: null, + city: null, + state: null, + zip: null, + foreign_province: null, + country_code: null, + validation_errors: null, + created_at: null, + updated_at: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099DivList.md b/docs/A1099/V2/Form1099DivList.md new file mode 100644 index 0000000..7da2300 --- /dev/null +++ b/docs/A1099/V2/Form1099DivList.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099DivList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **forms** | [**Array<Form1099DivListItem>**](Form1099DivListItem.md) | | [optional] | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099DivList.new( + forms: null, + form_type: null +) +``` + diff --git a/docs/A1099/V2/Form1099DivListItem.md b/docs/A1099/V2/Form1099DivListItem.md new file mode 100644 index 0000000..7b3e20c --- /dev/null +++ b/docs/A1099/V2/Form1099DivListItem.md @@ -0,0 +1,104 @@ +# AvalaraSdk::A1099::V2::Form1099DivListItem + +## Properties + +| 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] | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099DivListItem.new( + total_ordinary_dividends: null, + qualified_dividends: null, + total_capital_gain_distr: null, + unrecap_sec1250_gain: null, + section1202_gain: null, + collectibles_gain: null, + section897_ordinary_dividends: null, + section897_capital_gain: null, + nondividend_distributions: null, + federal_income_tax_withheld: null, + section199_a_dividends: null, + investment_expenses: null, + foreign_tax_paid: null, + foreign_country_or_us_possession: null, + cash_liquidation_distributions: null, + noncash_liquidation_distributions: null, + exempt_interest_dividends: null, + specified_private_activity_bond_interest_dividends: null, + fatca_filing_requirement: null, + state_and_local_withholding: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099DivRequest.md b/docs/A1099/V2/Form1099DivRequest.md new file mode 100644 index 0000000..ffb7c61 --- /dev/null +++ b/docs/A1099/V2/Form1099DivRequest.md @@ -0,0 +1,106 @@ +# AvalaraSdk::A1099::V2::Form1099DivRequest + +## Properties + +| 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] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **type** | **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099DivRequest.new( + total_ordinary_dividends: null, + qualified_dividends: null, + total_capital_gain_distr: null, + unrecap_sec1250_gain: null, + section1202_gain: null, + collectibles_gain: null, + section897_ordinary_dividends: null, + section897_capital_gain: null, + nondividend_distributions: null, + federal_income_tax_withheld: null, + section199_a_dividends: null, + investment_expenses: null, + foreign_tax_paid: null, + foreign_country_or_us_possession: null, + cash_liquidation_distributions: null, + noncash_liquidation_distributions: null, + exempt_interest_dividends: null, + specified_private_activity_bond_interest_dividends: null, + fatca_filing_requirement: null, + state_and_local_withholding: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099K.md b/docs/A1099/V2/Form1099K.md new file mode 100644 index 0000000..2042bed --- /dev/null +++ b/docs/A1099/V2/Form1099K.md @@ -0,0 +1,122 @@ +# AvalaraSdk::A1099::V2::Form1099K + +## Properties + +| 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] | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **Integer** | | [optional] | +| **issuer_reference_id** | **String** | | [optional] | +| **issuer_tin** | **String** | | [optional] | +| **tax_year** | **Integer** | | [optional] | +| **federal_efile** | **Boolean** | | [optional] | +| **federal_efile_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **state_efile** | **Boolean** | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | +| **postal_mail** | **Boolean** | | [optional] | +| **postal_mail_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **tin_match** | **Boolean** | | [optional] | +| **tin_match_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **address_verification** | **Boolean** | | [optional] | +| **address_verification_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **reference_id** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **type_of_tin** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **first_payee_name** | **String** | | [optional] | +| **second_payee_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **address_recipient_second** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **validation_errors** | [**Array<ValidationError>**](ValidationError.md) | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099K.new( + filer_type: PSE, + payment_type: MerchantPaymentCard, + payment_settlement_entity_name_phone_number: null, + gross_amount_payment_card: null, + card_not_present_transactions: null, + merchant_category_code: null, + payment_transaction_number: null, + 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: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + federal_efile: null, + federal_efile_status: null, + state_efile: null, + state_efile_status: null, + postal_mail: null, + postal_mail_status: null, + tin_match: null, + tin_match_status: null, + address_verification: null, + address_verification_status: null, + reference_id: null, + email: null, + type_of_tin: null, + tin: null, + first_payee_name: null, + second_payee_name: null, + address: null, + address_recipient_second: null, + city: null, + state: null, + zip: null, + foreign_province: null, + country_code: null, + validation_errors: null, + created_at: null, + updated_at: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099KList.md b/docs/A1099/V2/Form1099KList.md new file mode 100644 index 0000000..b41930e --- /dev/null +++ b/docs/A1099/V2/Form1099KList.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099KList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **forms** | [**Array<Form1099KListItem>**](Form1099KListItem.md) | | [optional] | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099KList.new( + forms: null, + form_type: null +) +``` + diff --git a/docs/A1099/V2/Form1099KListItem.md b/docs/A1099/V2/Form1099KListItem.md new file mode 100644 index 0000000..74d0b8e --- /dev/null +++ b/docs/A1099/V2/Form1099KListItem.md @@ -0,0 +1,106 @@ +# AvalaraSdk::A1099::V2::Form1099KListItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +| **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_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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099KListItem.new( + state_and_local_withholding: null, + filer_type: PSE, + payment_type: MerchantPaymentCard, + payment_settlement_entity_name_phone_number: null, + gross_amount_payment_card: null, + card_not_present_transactions: null, + merchant_category_code: null, + payment_transaction_number: null, + 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, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099KRequest.md b/docs/A1099/V2/Form1099KRequest.md new file mode 100644 index 0000000..a7ed8d8 --- /dev/null +++ b/docs/A1099/V2/Form1099KRequest.md @@ -0,0 +1,108 @@ +# AvalaraSdk::A1099::V2::Form1099KRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +| **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] | +| **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099KRequest.new( + state_and_local_withholding: null, + filer_type: null, + payment_type: null, + payment_settlement_entity_name_phone_number: null, + gross_amount_payment_card: null, + card_not_present_transactions: null, + merchant_category_code: null, + payment_transaction_number: null, + 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, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099List.md b/docs/A1099/V2/Form1099List.md new file mode 100644 index 0000000..5697624 --- /dev/null +++ b/docs/A1099/V2/Form1099List.md @@ -0,0 +1,18 @@ +# AvalaraSdk::A1099::V2::Form1099List + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **data** | [**Array<Form1099ListDataInner>**](Form1099ListDataInner.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099List.new( + data: null +) +``` + diff --git a/docs/A1099/V2/Form1099ListDataInner.md b/docs/A1099/V2/Form1099ListDataInner.md new file mode 100644 index 0000000..5e7e271 --- /dev/null +++ b/docs/A1099/V2/Form1099ListDataInner.md @@ -0,0 +1,53 @@ +# AvalaraSdk::A1099::V2::Form1099ListDataInner + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::Form1099ListDataInner.openapi_one_of +# => +# [ +# :'Form1099K', +# :'Form1099Misc', +# :'Form1099Nec', +# :'Form1099R' +# ] +``` + +### 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::Form1099ListDataInner.build(data) +# => # + +AvalaraSdk::A1099::V2::Form1099ListDataInner.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Form1099K` +- `Form1099Misc` +- `Form1099Nec` +- `Form1099R` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/Form1099Misc.md b/docs/A1099/V2/Form1099Misc.md new file mode 100644 index 0000000..1387a3c --- /dev/null +++ b/docs/A1099/V2/Form1099Misc.md @@ -0,0 +1,110 @@ +# AvalaraSdk::A1099::V2::Form1099Misc + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **rents** | **Float** | | [optional] | +| **royalties** | **Float** | | [optional] | +| **other_income** | **Float** | | [optional] | +| **fed_income_tax_withheld** | **Float** | | [optional] | +| **fishing_boat_proceeds** | **Float** | | [optional] | +| **medical_and_health_care** | **Float** | | [optional] | +| **nonemployee_compensation** | **Float** | | [optional] | +| **substitute_payments** | **Float** | | [optional] | +| **direct_sales_indicator** | **Boolean** | | [optional] | +| **crop_insurance_proceeds** | **Float** | | [optional] | +| **excess_golden_parachute** | **Float** | | [optional] | +| **gross_amount_paid_attorney** | **Float** | | [optional] | +| **section409_a_deferrals** | **Float** | | [optional] | +| **section409_a_income** | **Float** | | [optional] | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **Integer** | | [optional] | +| **issuer_reference_id** | **String** | | [optional] | +| **issuer_tin** | **String** | | [optional] | +| **tax_year** | **Integer** | | [optional] | +| **federal_efile** | **Boolean** | | [optional] | +| **federal_efile_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **state_efile** | **Boolean** | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | +| **postal_mail** | **Boolean** | | [optional] | +| **postal_mail_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **tin_match** | **Boolean** | | [optional] | +| **tin_match_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **address_verification** | **Boolean** | | [optional] | +| **address_verification_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **reference_id** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **type_of_tin** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **first_payee_name** | **String** | | [optional] | +| **second_payee_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **address_recipient_second** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **validation_errors** | [**Array<ValidationError>**](ValidationError.md) | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099Misc.new( + rents: null, + royalties: null, + other_income: null, + fed_income_tax_withheld: null, + fishing_boat_proceeds: null, + medical_and_health_care: null, + nonemployee_compensation: null, + substitute_payments: null, + direct_sales_indicator: null, + crop_insurance_proceeds: null, + excess_golden_parachute: null, + gross_amount_paid_attorney: null, + section409_a_deferrals: null, + section409_a_income: null, + id: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + federal_efile: null, + federal_efile_status: null, + state_efile: null, + state_efile_status: null, + postal_mail: null, + postal_mail_status: null, + tin_match: null, + tin_match_status: null, + address_verification: null, + address_verification_status: null, + reference_id: null, + email: null, + type_of_tin: null, + tin: null, + first_payee_name: null, + second_payee_name: null, + address: null, + address_recipient_second: null, + city: null, + state: null, + zip: null, + foreign_province: null, + country_code: null, + validation_errors: null, + created_at: null, + updated_at: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099MiscList.md b/docs/A1099/V2/Form1099MiscList.md new file mode 100644 index 0000000..bd4c188 --- /dev/null +++ b/docs/A1099/V2/Form1099MiscList.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099MiscList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **forms** | [**Array<Form1099MiscListItem>**](Form1099MiscListItem.md) | | [optional] | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099MiscList.new( + forms: null, + form_type: null +) +``` + diff --git a/docs/A1099/V2/Form1099MiscListItem.md b/docs/A1099/V2/Form1099MiscListItem.md new file mode 100644 index 0000000..e3cb1e9 --- /dev/null +++ b/docs/A1099/V2/Form1099MiscListItem.md @@ -0,0 +1,98 @@ +# AvalaraSdk::A1099::V2::Form1099MiscListItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +| **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_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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099MiscListItem.new( + state_and_local_withholding: null, + second_tin_notice: null, + rents: null, + royalties: null, + other_income: null, + fed_income_tax_withheld: null, + fishing_boat_proceeds: null, + medical_health_care_payments: null, + payer_made_direct_sales: null, + substitute_payments: null, + crop_insurance_proceeds: null, + gross_proceeds_paid_to_attorney: null, + fish_purchased_for_resale: null, + section409_a_deferrals: null, + fatca_filing_requirement: null, + excess_golden_parachute_payments: null, + nonqualified_deferred_compensation: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099MiscRequest.md b/docs/A1099/V2/Form1099MiscRequest.md new file mode 100644 index 0000000..9248e91 --- /dev/null +++ b/docs/A1099/V2/Form1099MiscRequest.md @@ -0,0 +1,100 @@ +# AvalaraSdk::A1099::V2::Form1099MiscRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **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] | +| **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099MiscRequest.new( + state_and_local_withholding: null, + second_tin_notice: null, + rents: null, + royalties: null, + other_income: null, + fed_income_tax_withheld: null, + fishing_boat_proceeds: null, + medical_health_care_payments: null, + payer_made_direct_sales: null, + substitute_payments: null, + crop_insurance_proceeds: null, + gross_proceeds_paid_to_attorney: null, + fish_purchased_for_resale: null, + section409_a_deferrals: null, + fatca_filing_requirement: null, + excess_golden_parachute_payments: null, + nonqualified_deferred_compensation: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099Nec.md b/docs/A1099/V2/Form1099Nec.md new file mode 100644 index 0000000..83dd15b --- /dev/null +++ b/docs/A1099/V2/Form1099Nec.md @@ -0,0 +1,88 @@ +# AvalaraSdk::A1099::V2::Form1099Nec + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **nonemployee_compensation** | **Float** | | [optional] | +| **federal_income_tax_withheld** | **Float** | | [optional] | +| **direct_sales_indicator** | **Boolean** | | [optional] | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **Integer** | | [optional] | +| **issuer_reference_id** | **String** | | [optional] | +| **issuer_tin** | **String** | | [optional] | +| **tax_year** | **Integer** | | [optional] | +| **federal_efile** | **Boolean** | | [optional] | +| **federal_efile_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **state_efile** | **Boolean** | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | +| **postal_mail** | **Boolean** | | [optional] | +| **postal_mail_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **tin_match** | **Boolean** | | [optional] | +| **tin_match_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **address_verification** | **Boolean** | | [optional] | +| **address_verification_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **reference_id** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **type_of_tin** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **first_payee_name** | **String** | | [optional] | +| **second_payee_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **address_recipient_second** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **validation_errors** | [**Array<ValidationError>**](ValidationError.md) | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099Nec.new( + nonemployee_compensation: null, + federal_income_tax_withheld: null, + direct_sales_indicator: null, + id: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + federal_efile: null, + federal_efile_status: null, + state_efile: null, + state_efile_status: null, + postal_mail: null, + postal_mail_status: null, + tin_match: null, + tin_match_status: null, + address_verification: null, + address_verification_status: null, + reference_id: null, + email: null, + type_of_tin: null, + tin: null, + first_payee_name: null, + second_payee_name: null, + address: null, + address_recipient_second: null, + city: null, + state: null, + zip: null, + foreign_province: null, + country_code: null, + validation_errors: null, + created_at: null, + updated_at: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099NecList.md b/docs/A1099/V2/Form1099NecList.md new file mode 100644 index 0000000..e9199cc --- /dev/null +++ b/docs/A1099/V2/Form1099NecList.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099NecList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **forms** | [**Array<Form1099NecListItem>**](Form1099NecListItem.md) | | [optional] | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099NecList.new( + forms: null, + form_type: null +) +``` + diff --git a/docs/A1099/V2/Form1099NecListItem.md b/docs/A1099/V2/Form1099NecListItem.md new file mode 100644 index 0000000..544c60c --- /dev/null +++ b/docs/A1099/V2/Form1099NecListItem.md @@ -0,0 +1,74 @@ +# AvalaraSdk::A1099::V2::Form1099NecListItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +| **second_tin_notice** | **Boolean** | | [optional] | +| **nonemployee_compensation** | **Float** | | [optional] | +| **payer_made_direct_sales** | **Boolean** | | [optional] | +| **federal_income_tax_withheld** | **Float** | | [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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099NecListItem.new( + state_and_local_withholding: null, + second_tin_notice: null, + nonemployee_compensation: null, + payer_made_direct_sales: null, + federal_income_tax_withheld: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099NecRequest.md b/docs/A1099/V2/Form1099NecRequest.md new file mode 100644 index 0000000..53047f2 --- /dev/null +++ b/docs/A1099/V2/Form1099NecRequest.md @@ -0,0 +1,76 @@ +# AvalaraSdk::A1099::V2::Form1099NecRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **second_tin_notice** | **Boolean** | | [optional] | +| **nonemployee_compensation** | **Float** | | [optional] | +| **payer_made_direct_sales** | **Boolean** | | [optional] | +| **federal_income_tax_withheld** | **Float** | | [optional] | +| **type** | **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099NecRequest.new( + state_and_local_withholding: null, + second_tin_notice: null, + nonemployee_compensation: null, + payer_made_direct_sales: null, + federal_income_tax_withheld: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099ProccessResult.md b/docs/A1099/V2/Form1099ProccessResult.md new file mode 100644 index 0000000..6b9cb83 --- /dev/null +++ b/docs/A1099/V2/Form1099ProccessResult.md @@ -0,0 +1,18 @@ +# AvalaraSdk::A1099::V2::Form1099ProccessResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job_data** | [**Data**](Data.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099ProccessResult.new( + job_data: null +) +``` + diff --git a/docs/A1099/V2/Form1099R.md b/docs/A1099/V2/Form1099R.md new file mode 100644 index 0000000..78a7501 --- /dev/null +++ b/docs/A1099/V2/Form1099R.md @@ -0,0 +1,122 @@ +# AvalaraSdk::A1099::V2::Form1099R + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **gross_distributions** | **Float** | | [optional] | +| **taxable_amount** | **Float** | | [optional] | +| **taxable_amount_not_determined** | **Boolean** | | [optional] | +| **total_distribution_indicator** | **Boolean** | | [optional] | +| **capital_gain** | **Float** | | [optional] | +| **fed_income_tax_withheld** | **Float** | | [optional] | +| **employee_contributions** | **Float** | | [optional] | +| **net_unrealized_appreciation** | **Float** | | [optional] | +| **distribution_code_required** | **String** | | [optional] | +| **distribution_code_optional** | **String** | | [optional] | +| **ira_sep_simple_indicator** | **Boolean** | | [optional] | +| **total_ira_sep_simple_distribution** | **Float** | | [optional] | +| **other** | **Float** | | [optional] | +| **other_percent** | **String** | | [optional] | +| **percentage_total_distribution** | **String** | | [optional] | +| **total_employee_contributions** | **Float** | | [optional] | +| **amount_allocable_to_irr** | **Float** | | [optional] | +| **first_year_designated_roth_contrib** | **String** | | [optional] | +| **fatca_requirement_indicator** | **Boolean** | | [optional] | +| **date_of_payment** | **String** | | [optional] | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **Integer** | | [optional] | +| **issuer_reference_id** | **String** | | [optional] | +| **issuer_tin** | **String** | | [optional] | +| **tax_year** | **Integer** | | [optional] | +| **federal_efile** | **Boolean** | | [optional] | +| **federal_efile_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **state_efile** | **Boolean** | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | +| **postal_mail** | **Boolean** | | [optional] | +| **postal_mail_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **tin_match** | **Boolean** | | [optional] | +| **tin_match_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **address_verification** | **Boolean** | | [optional] | +| **address_verification_status** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | +| **reference_id** | **String** | | [optional] | +| **email** | **String** | | [optional] | +| **type_of_tin** | **String** | | [optional] | +| **tin** | **String** | | [optional] | +| **first_payee_name** | **String** | | [optional] | +| **second_payee_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **address_recipient_second** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **foreign_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **validation_errors** | [**Array<ValidationError>**](ValidationError.md) | | [optional] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099R.new( + gross_distributions: null, + 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: null, + 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: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + federal_efile: null, + federal_efile_status: null, + state_efile: null, + state_efile_status: null, + postal_mail: null, + postal_mail_status: null, + tin_match: null, + tin_match_status: null, + address_verification: null, + address_verification_status: null, + reference_id: null, + email: null, + type_of_tin: null, + tin: null, + first_payee_name: null, + second_payee_name: null, + address: null, + address_recipient_second: null, + city: null, + state: null, + zip: null, + foreign_province: null, + country_code: null, + validation_errors: null, + created_at: null, + updated_at: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099RList.md b/docs/A1099/V2/Form1099RList.md new file mode 100644 index 0000000..43c09f4 --- /dev/null +++ b/docs/A1099/V2/Form1099RList.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099RList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **forms** | [**Array<Form1099RListItem>**](Form1099RListItem.md) | | [optional] | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099RList.new( + forms: null, + form_type: null +) +``` + diff --git a/docs/A1099/V2/Form1099RListItem.md b/docs/A1099/V2/Form1099RListItem.md new file mode 100644 index 0000000..3571bd7 --- /dev/null +++ b/docs/A1099/V2/Form1099RListItem.md @@ -0,0 +1,106 @@ +# AvalaraSdk::A1099::V2::Form1099RListItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +| **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_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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099RListItem.new( + state_and_local_withholding: null, + gross_distribution: null, + taxable_amount: null, + taxable_amount_not_determined: null, + total_distribution_determined: null, + capital_gain: null, + federal_income_tax_withheld: null, + employee_contributions_or_designated_roth_or_insurance_premiums: null, + net_unrealized_appreciation_in_employer_securities: null, + distribution_code: EarlyDistributionNoException, + second_distribution_code: null, + ira_sep_simple: null, + traditional_ira_sep_simple_or_roth_conversion_amount: null, + other_amount: null, + other_percentage: null, + total_distribution_percentage: null, + total_employee_contributions: null, + amount_allocable_to_irr_within5_years: null, + first_year_of_designated_roth_contribution: null, + fatca_filing_requirement: null, + date_of_payment: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099RRequest.md b/docs/A1099/V2/Form1099RRequest.md new file mode 100644 index 0000000..ab1d7ba --- /dev/null +++ b/docs/A1099/V2/Form1099RRequest.md @@ -0,0 +1,108 @@ +# AvalaraSdk::A1099::V2::Form1099RRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **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] | +| **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099RRequest.new( + state_and_local_withholding: null, + gross_distribution: null, + taxable_amount: null, + taxable_amount_not_determined: null, + total_distribution_determined: null, + capital_gain: null, + federal_income_tax_withheld: null, + employee_contributions_or_designated_roth_or_insurance_premiums: null, + net_unrealized_appreciation_in_employer_securities: null, + distribution_code: null, + second_distribution_code: null, + ira_sep_simple: null, + traditional_ira_sep_simple_or_roth_conversion_amount: null, + other_amount: null, + other_percentage: null, + total_distribution_percentage: null, + total_employee_contributions: null, + amount_allocable_to_irr_within5_years: null, + first_year_of_designated_roth_contribution: null, + fatca_filing_requirement: null, + date_of_payment: null, + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Form1099StatusDetail.md b/docs/A1099/V2/Form1099StatusDetail.md new file mode 100644 index 0000000..8134fb8 --- /dev/null +++ b/docs/A1099/V2/Form1099StatusDetail.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099StatusDetail + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time** | **String** | | [optional] | +| **status** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099StatusDetail.new( + time: null, + status: accepted +) +``` + diff --git a/docs/A1099/V2/FormRequestBase.md b/docs/A1099/V2/FormRequestBase.md new file mode 100644 index 0000000..6a0d8da --- /dev/null +++ b/docs/A1099/V2/FormRequestBase.md @@ -0,0 +1,64 @@ +# AvalaraSdk::A1099::V2::FormRequestBase + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::FormRequestBase.new( + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/FormRequestModel.md b/docs/A1099/V2/FormRequestModel.md new file mode 100644 index 0000000..dc7b20d --- /dev/null +++ b/docs/A1099/V2/FormRequestModel.md @@ -0,0 +1,38 @@ +# AvalaraSdk::A1099::V2::FormRequestModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **form_type** | **String** | \"W9\" is currently the only supported value | [optional] | +| **company_id** | **Integer** | Track1099's ID of your company, found in the W-9 UI | [optional] | +| **company_name** | **String** | Name of your company, set in the W-9 UI | [optional] | +| **company_email** | **String** | Contact email of your company, set in the W-9 UI | [optional] | +| **reference_id** | **String** | Your internal identifier for the vendor from whom you are requesting a form | [optional] | +| **signed_at** | **Time** | The timestamp this vendor (identified by your ReferenceId) last signed a complete W-9, null if you did not include a ReferenceId or the vendor has not yet signed a W-9 in Track1099 | [optional] | +| **tin_match_status** | **String** | Result of IRS TIN match query for name and TIN in the last signed form, null if signed_at is null | [optional] | +| **expires_at** | **Time** | Timestamp when this FormRequest will expire, ttl (or 3600) seconds from creation | [optional] | +| **signed_pdf** | **String** | URL of PDF representation of just-signed form, otherwise null. Integrations may use this value to offer a \"download for your records\" function after a vendor completes and signs a form. Link expires at the same time as this FormRequest. Treat the format of this URL as opaque and expect it to change in the future. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::FormRequestModel.new( + id: d0d09a2f-619e-4e9d-aae4-3311d9e0c67c, + type: 0, + form_type: 0, + company_id: 2345678, + company_name: ACME Corp, + company_email: roadrunner@acmecorp.com, + reference_id: SE-02453450, + signed_at: 2022-04-29T15:19:42Z, + tin_match_status: 1, + expires_at: 2022-04-29T15:19:42Z, + signed_pdf: +) +``` + diff --git a/docs/A1099/V2/FormResponseBase.md b/docs/A1099/V2/FormResponseBase.md new file mode 100644 index 0000000..b97a91a --- /dev/null +++ b/docs/A1099/V2/FormResponseBase.md @@ -0,0 +1,54 @@ +# AvalaraSdk::A1099::V2::FormResponseBase + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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_federal_id** | **String** | | [optional] | +| **federal_id_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::FormResponseBase.new( + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_federal_id: null, + federal_id_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: null, + city: null, + state: null, + zip: null, + recipient_email: null, + account_number: null, + office_code: null, + recipient_non_us_province: null, + country_code: null +) +``` + diff --git a/docs/A1099/V2/FormSingleRequestBase.md b/docs/A1099/V2/FormSingleRequestBase.md new file mode 100644 index 0000000..c7bfe09 --- /dev/null +++ b/docs/A1099/V2/FormSingleRequestBase.md @@ -0,0 +1,66 @@ +# AvalaraSdk::A1099::V2::FormSingleRequestBase + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **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] | +| **tin_type** | **Integer** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **street_address** | **String** | | [optional] | +| **street_address_line2** | **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::FormSingleRequestBase.new( + type: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + tin_type: null, + recipient_second_name: null, + street_address: null, + street_address_line2: 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/Forms1099Api.md b/docs/A1099/V2/Forms1099Api.md new file mode 100644 index 0000000..a95881f --- /dev/null +++ b/docs/A1099/V2/Forms1099Api.md @@ -0,0 +1,576 @@ +# AvalaraSdk::A1099::V2::Forms1099Api + +All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* + +| 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 + +> bulk_upsert1099_forms(avalara_version, x_correlation_id, opts) + +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\": 1, \"RecipientSecondName\": \"Jane Doe\", \"StreetAddress\": \"123 Main Street\", \"StreetAddressLine2\": \"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\": 1, \"streetAddress\": \"123 Center St\", \"streetAddressLine2\": \"\", \"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. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Forms1099Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = '1ded0db3-4f25-4b15-b159-6d1467e6faac' # String | Unique correlation Id in a GUID format +opts = { + dry_run: true, # Boolean | + bulk_upsert1099_forms_request: AvalaraSdk::A1099::V2::Form1099DivList.new # BulkUpsert1099FormsRequest | +} + +begin + # Creates or updates multiple 1099 forms. + result = api_instance.bulk_upsert1099_forms(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->bulk_upsert1099_forms: #{e}" +end +``` + +#### Using the bulk_upsert1099_forms_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> bulk_upsert1099_forms_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # Creates or updates multiple 1099 forms. + data, status_code, headers = api_instance.bulk_upsert1099_forms_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->bulk_upsert1099_forms_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **dry_run** | **Boolean** | | [optional][default to false] | +| **bulk_upsert1099_forms_request** | [**BulkUpsert1099FormsRequest**](BulkUpsert1099FormsRequest.md) | | [optional] | + +### Return type + +[**Form1099ProccessResult**](Form1099ProccessResult.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +## create1099_form + +> create1099_form(avalara_version, x_correlation_id, opts) + +Creates a 1099 form. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Forms1099Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = '35eadeb5-51d8-4eb3-9442-90086637d517' # String | Unique correlation Id in a GUID format +opts = { + i_create_form1099_request: AvalaraSdk::A1099::V2::Form1099DivRequest.new # ICreateForm1099Request | +} + +begin + # Creates a 1099 form. + result = api_instance.create1099_form(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->create1099_form: #{e}" +end +``` + +#### Using the create1099_form_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create1099_form_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # Creates a 1099 form. + data, status_code, headers = api_instance.create1099_form_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->create1099_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **i_create_form1099_request** | [**ICreateForm1099Request**](ICreateForm1099Request.md) | | [optional] | + +### Return type + +[**FormResponseBase**](FormResponseBase.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +## delete1099_form + +> delete1099_form(id, avalara_version, x_correlation_id) + +Deletes a 1099 form. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::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 +x_correlation_id = 'edf4d49e-9ce1-40be-ae32-9da91e5fcb39' # String | Unique correlation Id in a GUID format + +begin + # Deletes a 1099 form. + api_instance.delete1099_form(id, avalara_version, x_correlation_id) +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->delete1099_form: #{e}" +end +``` + +#### Using the delete1099_form_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete1099_form_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Deletes a 1099 form. + data, status_code, headers = api_instance.delete1099_form_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->delete1099_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the desired form to delete. | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +nil (empty response body) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get1099_form + +> get1099_form(id, avalara_version, x_correlation_id) + +Retrieves a 1099 form. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Forms1099Api.new api_client + +id = 'id_example' # String | +avalara_version = '2.0' # String | API version +x_correlation_id = 'c9fe4a5f-69af-4b47-9ad3-f483a9328e4e' # String | Unique correlation Id in a GUID format + +begin + # Retrieves a 1099 form. + result = api_instance.get1099_form(id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->get1099_form: #{e}" +end +``` + +#### Using the get1099_form_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get1099_form_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Retrieves a 1099 form. + data, status_code, headers = api_instance.get1099_form_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->get1099_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**FormResponseBase**](FormResponseBase.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get1099_form_pdf + +> get1099_form_pdf(id, avalara_version, x_correlation_id, opts) + +Retrieves the PDF file for a single 1099 by form id. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Forms1099Api.new api_client + +id = 'id_example' # String | +avalara_version = '2.0' # String | API version +x_correlation_id = '314852b3-0f9f-42c3-aafe-f294a7c7fe12' # String | Unique correlation Id in a GUID format +opts = { + mark_edelivered: true # Boolean | The parameter for marked e-delivered +} + +begin + # Retrieves the PDF file for a single 1099 by form id. + result = api_instance.get1099_form_pdf(id, avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->get1099_form_pdf: #{e}" +end +``` + +#### Using the get1099_form_pdf_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get1099_form_pdf_with_http_info(id, avalara_version, x_correlation_id, opts) + +```ruby +begin + # Retrieves the PDF file for a single 1099 by form id. + data, status_code, headers = api_instance.get1099_form_pdf_with_http_info(id, avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->get1099_form_pdf_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **mark_edelivered** | **Boolean** | The parameter for marked e-delivered | [optional] | + +### Return type + +[**FormResponseBase**](FormResponseBase.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list1099_forms + +> list1099_forms(avalara_version, x_correlation_id, opts) + +Retrieves a list of 1099 forms based on query parameters. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Forms1099Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = 'f37c790b-837b-4b6e-b884-0c0f7aae2ea8' # String | Unique correlation Id in a GUID format +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 firstPayeeName 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 firstPayeeName updatedAt +} + +begin + # Retrieves a list of 1099 forms based on query parameters. + result = api_instance.list1099_forms(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->list1099_forms: #{e}" +end +``` + +#### Using the list1099_forms_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list1099_forms_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # Retrieves a list of 1099 forms based on query parameters. + data, status_code, headers = api_instance.list1099_forms_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->list1099_forms_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **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 firstPayeeName mailStatus - possible values are: sent, unscheduled, pending, delivered referenceId tinMatchStatus - possible values are: none, pending, matched, failed type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC updatedAt validity - possible values are: true, false | [optional] | +| **top** | **Integer** | If nonzero, return no more than this number of results. Used with skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional][default to 10] | +| **skip** | **Integer** | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. | [optional][default to 0] | +| **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 firstPayeeName updatedAt | [optional] | + +### Return type + +[**Form1099List**](Form1099List.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update1099_form + +> update1099_form(id, avalara_version, x_correlation_id, opts) + +Updates a 1099 form. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Forms1099Api.new api_client + +id = 'id_example' # String | +avalara_version = '2.0' # String | API version +x_correlation_id = 'fb554f8c-95f6-4194-9043-900ae946030c' # String | Unique correlation Id in a GUID format +opts = { + i_update_form1099_request: AvalaraSdk::A1099::V2::Form1099DivRequest.new # IUpdateForm1099Request | +} + +begin + # Updates a 1099 form. + result = api_instance.update1099_form(id, avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Forms1099Api->update1099_form: #{e}" +end +``` + +#### Using the update1099_form_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update1099_form_with_http_info(id, avalara_version, x_correlation_id, opts) + +```ruby +begin + # Updates a 1099 form. + data, status_code, headers = api_instance.update1099_form_with_http_info(id, avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Forms1099Api->update1099_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **i_update_form1099_request** | [**IUpdateForm1099Request**](IUpdateForm1099Request.md) | | [optional] | + +### Return type + +[**FormResponseBase**](FormResponseBase.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + diff --git a/docs/A1099/V2/FormsW9Api.md b/docs/A1099/V2/FormsW9Api.md new file mode 100644 index 0000000..28f7d4e --- /dev/null +++ b/docs/A1099/V2/FormsW9Api.md @@ -0,0 +1,660 @@ +# AvalaraSdk::A1099::V2::FormsW9Api + +All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* + +| 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 | +| [**get_w9_form**](FormsW9Api.md#get_w9_form) | **GET** /w9/forms/{id} | Retrieve a W9/W4/W8 form | +| [**get_w9_form_request**](FormsW9Api.md#get_w9_form_request) | **GET** /w9/forms/requests/{formRequestId} | Retrieve a form request | +| [**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 | +| [**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 | + + +## create_w9_form + +> create_w9_form(avalara_version, x_correlation_id, opts) + +Create a W9/W4/W8 form + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = '5597173b-9f5b-4f24-8c59-e451219875ee' # String | Unique correlation Id in a GUID format +opts = { + iw9_form_data_models_one_of: AvalaraSdk::A1099::V2::W4FormDataModel.new # IW9FormDataModelsOneOf | Form to be created +} + +begin + # Create a W9/W4/W8 form + result = api_instance.create_w9_form(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->create_w9_form: #{e}" +end +``` + +#### Using the create_w9_form_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_w9_form_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # Create a W9/W4/W8 form + data, status_code, headers = api_instance.create_w9_form_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->create_w9_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **iw9_form_data_models_one_of** | [**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) | Form to be created | [optional] | + +### Return type + +[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +## delete_w9_form + +> delete_w9_form(id, avalara_version, x_correlation_id) + +Delete a form + +Delete a form + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +id = 'id_example' # String | Id of the form to delete +avalara_version = '2.0' # String | API version +x_correlation_id = 'd8b9b636-90cb-47e8-abb3-183deeb8b1be' # String | Unique correlation Id in a GUID format + +begin + # Delete a form + api_instance.delete_w9_form(id, avalara_version, x_correlation_id) +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->delete_w9_form: #{e}" +end +``` + +#### Using the delete_w9_form_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_w9_form_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Delete a form + data, status_code, headers = api_instance.delete_w9_form_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->delete_w9_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the form to delete | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +nil (empty response body) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_w9_form + +> get_w9_form(id, avalara_version, x_correlation_id) + +Retrieve a W9/W4/W8 form + +Retrieve a W9/W4/W8 form + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +id = 'id_example' # String | Id of the form +avalara_version = '2.0' # String | API version +x_correlation_id = 'c94f4b08-050e-45b8-a62c-266aa7fe15ba' # String | Unique correlation Id in a GUID format + +begin + # Retrieve a W9/W4/W8 form + result = api_instance.get_w9_form(id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->get_w9_form: #{e}" +end +``` + +#### Using the get_w9_form_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_w9_form_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Retrieve a W9/W4/W8 form + data, status_code, headers = api_instance.get_w9_form_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->get_w9_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the form | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_w9_form_request + +> get_w9_form_request(form_request_id, avalara_version, x_correlation_id) + +Retrieve a form request + +Retrieve a form request after creation: not likely to be useful except in testing. Previously-valid form requests will be Not Found after `expires_at`. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +form_request_id = 'form_request_id_example' # String | +avalara_version = '2.0' # String | API version +x_correlation_id = '6f9c508a-38ae-403e-b1d9-a45c6031241c' # String | Unique correlation Id in a GUID format + +begin + # Retrieve a form request + result = api_instance.get_w9_form_request(form_request_id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->get_w9_form_request: #{e}" +end +``` + +#### Using the get_w9_form_request_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_w9_form_request_with_http_info(form_request_id, avalara_version, x_correlation_id) + +```ruby +begin + # Retrieve a form request + data, status_code, headers = api_instance.get_w9_form_request_with_http_info(form_request_id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->get_w9_form_request_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **form_request_id** | **String** | | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**FormRequestModel**](FormRequestModel.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_w9_forms + +> list_w9_forms(avalara_version, x_correlation_id, opts) + +List W9/W4/W8 forms. + +List W9/W4/W8 forms. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = 'a6e7aff4-3c52-4caa-b332-ccb199f51da3' # String | Unique correlation Id in a GUID format +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 +} + +begin + # List W9/W4/W8 forms. + result = api_instance.list_w9_forms(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->list_w9_forms: #{e}" +end +``` + +#### Using the list_w9_forms_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_w9_forms_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # List W9/W4/W8 forms. + data, status_code, headers = api_instance.list_w9_forms_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->list_w9_forms_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **filter** | **String** | A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. | [optional] | +| **top** | **Integer** | If nonzero, return no more than this number of results. Used with skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional][default to 10] | +| **skip** | **Integer** | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. | [optional][default to 0] | +| **order_by** | **String** | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. | [optional] | +| **count** | **Boolean** | When true, returns a @recordSetCount in the result set | [optional] | + +### Return type + +[**PaginatedW9FormsModel**](PaginatedW9FormsModel.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## send_w9_form_email + +> send_w9_form_email(id, avalara_version, x_correlation_id) + +Sends a W9 email request to a vendor/payee + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::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 +x_correlation_id = '0727cf38-4b0b-4f71-a61f-b4fb6918c976' # String | Unique correlation Id in a GUID format + +begin + # Sends a W9 email request to a vendor/payee + result = api_instance.send_w9_form_email(id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->send_w9_form_email: #{e}" +end +``` + +#### Using the send_w9_form_email_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> send_w9_form_email_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Sends a W9 email request to a vendor/payee + data, status_code, headers = api_instance.send_w9_form_email_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->send_w9_form_email_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The ID of the W9/W4/W8 form. | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_w9_form + +> update_w9_form(id, avalara_version, x_correlation_id, opts) + +Update a W9/W4/W8 form + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +id = 'id_example' # String | Id of the form to update +avalara_version = '2.0' # String | API version +x_correlation_id = 'dcd6d6cb-d31d-4ee8-b8dd-0cddd81376bd' # String | Unique correlation Id in a GUID format +opts = { + iw9_form_data_models_one_of: AvalaraSdk::A1099::V2::W4FormDataModel.new # IW9FormDataModelsOneOf | Form to be updated +} + +begin + # Update a W9/W4/W8 form + result = api_instance.update_w9_form(id, avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->update_w9_form: #{e}" +end +``` + +#### Using the update_w9_form_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_w9_form_with_http_info(id, avalara_version, x_correlation_id, opts) + +```ruby +begin + # Update a W9/W4/W8 form + data, status_code, headers = api_instance.update_w9_form_with_http_info(id, avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->update_w9_form_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the form to update | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **iw9_form_data_models_one_of** | [**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) | Form to be updated | [optional] | + +### Return type + +[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +## upload_w9_files + +> String upload_w9_files(id, avalara_version, x_correlation_id, opts) + +Upload files for a W9/W4/W8 form + +Upload files for a W9/W4/W8 form + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::FormsW9Api.new api_client + +id = 'id_example' # String | Id of the form +avalara_version = '2.0' # String | API version +x_correlation_id = 'a3cd6765-c6df-4223-86db-b9942a3cd56e' # String | Unique correlation Id in a GUID format +opts = { + 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, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling FormsW9Api->upload_w9_files: #{e}" +end +``` + +#### Using the upload_w9_files_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> upload_w9_files_with_http_info(id, avalara_version, x_correlation_id, opts) + +```ruby +begin + # Upload files for a W9/W4/W8 form + data, status_code, headers = api_instance.upload_w9_files_with_http_info(id, avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => String +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling FormsW9Api->upload_w9_files_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the form | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **file** | **File** | | [optional] | + +### Return type + +**String** + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + diff --git a/docs/A1099/V2/HttpValidationProblemDetails.md b/docs/A1099/V2/HttpValidationProblemDetails.md new file mode 100644 index 0000000..81c77d6 --- /dev/null +++ b/docs/A1099/V2/HttpValidationProblemDetails.md @@ -0,0 +1,28 @@ +# AvalaraSdk::A1099::V2::HttpValidationProblemDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **errors** | **Hash<String, Array<String>>** | | [optional] | +| **type** | **String** | | [optional] | +| **title** | **String** | | [optional] | +| **status** | **Integer** | | [optional] | +| **detail** | **String** | | [optional] | +| **instance** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::HttpValidationProblemDetails.new( + errors: null, + type: null, + title: null, + status: null, + detail: null, + instance: null +) +``` + diff --git a/docs/A1099/V2/ICreateForm1099Request.md b/docs/A1099/V2/ICreateForm1099Request.md new file mode 100644 index 0000000..fa6be95 --- /dev/null +++ b/docs/A1099/V2/ICreateForm1099Request.md @@ -0,0 +1,51 @@ +# AvalaraSdk::A1099::V2::ICreateForm1099Request + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::ICreateForm1099Request.openapi_one_of +# => +# [ +# :'Form1099DivRequest', +# :'Form1099MiscRequest', +# :'Form1099NecRequest' +# ] +``` + +### 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::ICreateForm1099Request.build(data) +# => # + +AvalaraSdk::A1099::V2::ICreateForm1099Request.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Form1099DivRequest` +- `Form1099MiscRequest` +- `Form1099NecRequest` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/IUpdateForm1099Request.md b/docs/A1099/V2/IUpdateForm1099Request.md new file mode 100644 index 0000000..78545f1 --- /dev/null +++ b/docs/A1099/V2/IUpdateForm1099Request.md @@ -0,0 +1,51 @@ +# AvalaraSdk::A1099::V2::IUpdateForm1099Request + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::IUpdateForm1099Request.openapi_one_of +# => +# [ +# :'Form1099DivRequest', +# :'Form1099MiscRequest', +# :'Form1099NecRequest' +# ] +``` + +### 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::IUpdateForm1099Request.build(data) +# => # + +AvalaraSdk::A1099::V2::IUpdateForm1099Request.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Form1099DivRequest` +- `Form1099MiscRequest` +- `Form1099NecRequest` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/IW9FormDataModelsOneOf.md b/docs/A1099/V2/IW9FormDataModelsOneOf.md new file mode 100644 index 0000000..33aa9af --- /dev/null +++ b/docs/A1099/V2/IW9FormDataModelsOneOf.md @@ -0,0 +1,55 @@ +# AvalaraSdk::A1099::V2::IW9FormDataModelsOneOf + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::IW9FormDataModelsOneOf.openapi_one_of +# => +# [ +# :'W4FormDataModel', +# :'W8BenFormDataModel', +# :'W8BeneFormDataModel', +# :'W8ImyFormDataModel', +# :'W9FormDataModel' +# ] +``` + +### 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::IW9FormDataModelsOneOf.build(data) +# => # + +AvalaraSdk::A1099::V2::IW9FormDataModelsOneOf.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `W4FormDataModel` +- `W8BenFormDataModel` +- `W8BeneFormDataModel` +- `W8ImyFormDataModel` +- `W9FormDataModel` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/IssuerCommand.md b/docs/A1099/V2/IssuerCommand.md new file mode 100644 index 0000000..bdaa440 --- /dev/null +++ b/docs/A1099/V2/IssuerCommand.md @@ -0,0 +1,46 @@ +# AvalaraSdk::A1099::V2::IssuerCommand + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Legal name, not DBA | [optional] | +| **name_dba** | **String** | Optional DBA name or continuation of a long legal name | [optional] | +| **tin** | **String** | Tax identification number | [optional] | +| **reference_id** | **String** | Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. | [optional] | +| **telephone** | **String** | Telephone number | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **country_code** | **String** | If there is a transfer agent, use the shipping address of the transfer agent. | [optional] | +| **email** | **String** | Email address | [optional] | +| **address** | **String** | Address | [optional] | +| **city** | **String** | City | [optional] | +| **state** | **String** | State | [optional] | +| **zip** | **String** | Zip code | [optional] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **transfer_agent_name** | **String** | Transfer Agent's Name | [optional] | +| **last_filing** | **Boolean** | Last year of filing for this payer | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::IssuerCommand.new( + name: null, + name_dba: null, + tin: null, + reference_id: null, + telephone: null, + tax_year: null, + country_code: null, + email: null, + address: null, + city: null, + state: null, + zip: null, + foreign_province: null, + transfer_agent_name: null, + last_filing: null +) +``` + diff --git a/docs/A1099/V2/IssuerResponse.md b/docs/A1099/V2/IssuerResponse.md new file mode 100644 index 0000000..2e4a3b1 --- /dev/null +++ b/docs/A1099/V2/IssuerResponse.md @@ -0,0 +1,52 @@ +# AvalaraSdk::A1099::V2::IssuerResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier set when the record is created | [optional][readonly] | +| **name** | **String** | Legal name, not DBA | [optional] | +| **name_dba** | **String** | Optional DBA name or continuation of a long legal name | [optional] | +| **tin** | **String** | Tax identification number | [optional] | +| **reference_id** | **String** | Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. | [optional] | +| **telephone** | **String** | Telephone number | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **country_code** | **String** | If there is a transfer agent, use the address of the transfer agent. | [optional] | +| **email** | **String** | Email address | [optional] | +| **address** | **String** | Address | [optional] | +| **city** | **String** | City | [optional] | +| **state** | **String** | State | [optional] | +| **zip** | **String** | Zip code | [optional] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **transfer_agent_name** | **String** | Transfer Agent's Name | [optional] | +| **last_filing** | **Boolean** | Last year of filing for this payer | [optional] | +| **created_at** | **Time** | Date time when the issuer was created | [optional][readonly] | +| **updated_at** | **Time** | Date time when the issuer was updated | [optional][readonly] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::IssuerResponse.new( + id: 0, + name: Acme Corp, + name_dba: Second Name Corp, + tin: 23-8234555, + reference_id: 1891810-9819891, + telephone: 520-555-1234, + tax_year: 2024, + country_code: US, + email: roadrunner@acmecorp.com, + address: 1234 Meep Meep Blvd, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: 1981981, + transfer_agent_name: test, + last_filing: false, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/Issuers1099Api.md b/docs/A1099/V2/Issuers1099Api.md new file mode 100644 index 0000000..8d2e49d --- /dev/null +++ b/docs/A1099/V2/Issuers1099Api.md @@ -0,0 +1,423 @@ +# AvalaraSdk::A1099::V2::Issuers1099Api + +All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**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_issuers**](Issuers1099Api.md#get_issuers) | **GET** /1099/issuers | List issuers | +| [**update_issuer**](Issuers1099Api.md#update_issuer) | **PUT** /1099/issuers/{id} | Update an issuer | + + +## create_issuer + +> create_issuer(avalara_version, x_correlation_id, opts) + +Create an issuer + +Create a new issuer + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Issuers1099Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = 'bb3c3258-4a6e-4dc8-a958-a699cfb3772e' # String | Unique correlation Id in a GUID format +opts = { + issuer_command: AvalaraSdk::A1099::V2::IssuerCommand.new # IssuerCommand | The issuer to create +} + +begin + # Create an issuer + result = api_instance.create_issuer(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Issuers1099Api->create_issuer: #{e}" +end +``` + +#### Using the create_issuer_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_issuer_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # Create an issuer + data, status_code, headers = api_instance.create_issuer_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Issuers1099Api->create_issuer_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **issuer_command** | [**IssuerCommand**](IssuerCommand.md) | The issuer to create | [optional] | + +### Return type + +[**IssuerResponse**](IssuerResponse.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +## delete_issuer + +> delete_issuer(id, avalara_version, x_correlation_id) + +Delete an issuer + +Delete an issuer + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Issuers1099Api.new api_client + +id = 'id_example' # String | Id of the issuer to delete +avalara_version = '2.0' # String | API version +x_correlation_id = 'ca05554f-4b06-4f80-ba5e-717d6edfcd67' # String | Unique correlation Id in a GUID format + +begin + # Delete an issuer + api_instance.delete_issuer(id, avalara_version, x_correlation_id) +rescue AvalaraSdk::ApiError => e + puts "Error when calling Issuers1099Api->delete_issuer: #{e}" +end +``` + +#### Using the delete_issuer_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_issuer_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Delete an issuer + data, status_code, headers = api_instance.delete_issuer_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Issuers1099Api->delete_issuer_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the issuer to delete | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +nil (empty response body) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_issuer + +> get_issuer(id, avalara_version, x_correlation_id) + +Get an issuer + +Get an issuer + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Issuers1099Api.new api_client + +id = 'id_example' # String | +avalara_version = '2.0' # String | API version +x_correlation_id = 'ac852ed7-4d27-4844-bb38-3ad83c7ba46c' # String | Unique correlation Id in a GUID format + +begin + # Get an issuer + result = api_instance.get_issuer(id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Issuers1099Api->get_issuer: #{e}" +end +``` + +#### Using the get_issuer_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_issuer_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Get an issuer + data, status_code, headers = api_instance.get_issuer_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Issuers1099Api->get_issuer_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**IssuerResponse**](IssuerResponse.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_issuers + +> get_issuers(avalara_version, x_correlation_id, opts) + +List issuers + +List issuers for a given tax year. Filterable fields are name, referenceId and taxYear + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Issuers1099Api.new api_client + +avalara_version = '2.0' # String | API version +x_correlation_id = 'a48293cc-19f2-4971-9fde-c856cc131200' # String | Unique correlation Id in a GUID format +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. + 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 | 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. +} + +begin + # List issuers + result = api_instance.get_issuers(avalara_version, x_correlation_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Issuers1099Api->get_issuers: #{e}" +end +``` + +#### Using the get_issuers_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_issuers_with_http_info(avalara_version, x_correlation_id, opts) + +```ruby +begin + # List issuers + data, status_code, headers = api_instance.get_issuers_with_http_info(avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Issuers1099Api->get_issuers_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **filter** | **String** | A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. | [optional] | +| **top** | **Integer** | If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. | [optional] | +| **skip** | **Integer** | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. | [optional] | +| **order_by** | **String** | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. | [optional] | +| **count** | **Boolean** | If true, return the global count of elements in the collection. | [optional] | +| **count_only** | **Boolean** | If true, return ONLY the global count of elements in the collection. It only applies when count=true. | [optional] | + +### Return type + +[**PaginatedQueryResultModelIssuerResponse**](PaginatedQueryResultModelIssuerResponse.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_issuer + +> update_issuer(id, avalara_version, x_correlation_id, opts) + +Update an issuer + +Update an existing issuer + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::A1099::V2::Issuers1099Api.new api_client + +id = 'id_example' # String | Id of the issuer to Update +avalara_version = '2.0' # String | API version +x_correlation_id = '0c618dc9-79c1-424f-8b6a-6a80c766d673' # String | Unique correlation Id in a GUID format +opts = { + issuer_command: AvalaraSdk::A1099::V2::IssuerCommand.new # IssuerCommand | The issuer to update +} + +begin + # Update an issuer + api_instance.update_issuer(id, avalara_version, x_correlation_id, opts) +rescue AvalaraSdk::ApiError => e + puts "Error when calling Issuers1099Api->update_issuer: #{e}" +end +``` + +#### Using the update_issuer_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_issuer_with_http_info(id, avalara_version, x_correlation_id, opts) + +```ruby +begin + # Update an issuer + data, status_code, headers = api_instance.update_issuer_with_http_info(id, avalara_version, x_correlation_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Issuers1099Api->update_issuer_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Id of the issuer to Update | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | +| **issuer_command** | [**IssuerCommand**](IssuerCommand.md) | The issuer to update | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + diff --git a/docs/A1099/V2/JobResult.md b/docs/A1099/V2/JobResult.md new file mode 100644 index 0000000..206e6a0 --- /dev/null +++ b/docs/A1099/V2/JobResult.md @@ -0,0 +1,52 @@ +# AvalaraSdk::A1099::V2::JobResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **dry_run** | **Boolean** | | [optional] | +| **upsert** | **Boolean** | | [optional] | +| **status** | **String** | | [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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::JobResult.new( + id: null, + type: null, + dry_run: null, + upsert: null, + status: null, + error_message: null, + total_processed: null, + total_rows: null, + updated_valid: null, + updated_no_email: null, + updated_invalid: null, + skipped_duplicate: null, + skipped_invalid: null, + skipped_multiple_matches: null, + not_found: null, + created_invalid: null, + created_no_email: null, + created_valid: null +) +``` + diff --git a/docs/A1099/V2/Jobs1099Api.md b/docs/A1099/V2/Jobs1099Api.md new file mode 100644 index 0000000..1faffb5 --- /dev/null +++ b/docs/A1099/V2/Jobs1099Api.md @@ -0,0 +1,87 @@ +# AvalaraSdk::A1099::V2::Jobs1099Api + +All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_job**](Jobs1099Api.md#get_job) | **GET** /1099/jobs/{id} | Retrieves information about the job | + + +## get_job + +> get_job(id, avalara_version, x_correlation_id) + +Retrieves information about the job + +Retrieves information about the job + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::A1099::V2.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::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 +x_correlation_id = '68c7de82-2685-4e81-b0e9-77a78d3c601b' # String | Unique correlation Id in a GUID format + +begin + # Retrieves information about the job + result = api_instance.get_job(id, avalara_version, x_correlation_id) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling Jobs1099Api->get_job: #{e}" +end +``` + +#### Using the get_job_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_job_with_http_info(id, avalara_version, x_correlation_id) + +```ruby +begin + # Retrieves information about the job + data, status_code, headers = api_instance.get_job_with_http_info(id, avalara_version, x_correlation_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::A1099::V2::ApiError => e + puts "Error when calling Jobs1099Api->get_job_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Job id obtained from other API responses, like `/1099/bulk-upsert`. | | +| **avalara_version** | **String** | API version | | +| **x_correlation_id** | **String** | Unique correlation Id in a GUID format | | + +### Return type + +[**JobResult**](JobResult.md) + +### Authorization + +[bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/A1099/V2/Link.md b/docs/A1099/V2/Link.md new file mode 100644 index 0000000..a17ec67 --- /dev/null +++ b/docs/A1099/V2/Link.md @@ -0,0 +1,18 @@ +# AvalaraSdk::A1099::V2::Link + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_self** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Link.new( + _self: null +) +``` + diff --git a/docs/A1099/V2/PaginatedQueryResultModel.md b/docs/A1099/V2/PaginatedQueryResultModel.md new file mode 100644 index 0000000..2331190 --- /dev/null +++ b/docs/A1099/V2/PaginatedQueryResultModel.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::PaginatedQueryResultModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recordset_count** | **Integer** | | [optional] | +| **value** | **Array<Object>** | | [optional] | +| **next_link** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PaginatedQueryResultModel.new( + recordset_count: null, + value: null, + next_link: null +) +``` + diff --git a/docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md b/docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md new file mode 100644 index 0000000..499f932 --- /dev/null +++ b/docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::PaginatedQueryResultModelCompanyResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recordset_count** | **Integer** | | [optional] | +| **value** | [**Array<CompanyResponse>**](CompanyResponse.md) | | [optional] | +| **next_link** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PaginatedQueryResultModelCompanyResponse.new( + recordset_count: null, + value: [{"id":"","referenceId":"","groupName":"","name":"","dbaName":"","address":"","city":"","state":"","foreignProvince":"","zip":"","countryCode":"","email":"","telephone":"","tin":"","doTinMatch":null,"resendRequests":null,"resendIntervalDays":null,"maxReminderAttempts":null,"createdAt":null,"updatedAt":null}], + next_link: null +) +``` + diff --git a/docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md b/docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md new file mode 100644 index 0000000..2299d8b --- /dev/null +++ b/docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::PaginatedQueryResultModelIssuerResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recordset_count** | **Integer** | | [optional] | +| **value** | [**Array<IssuerResponse>**](IssuerResponse.md) | | [optional] | +| **next_link** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PaginatedQueryResultModelIssuerResponse.new( + recordset_count: null, + value: [{"id":"0","name":"Acme Corp","nameDba":"Second Name Corp","tin":"23-8234555","referenceId":"1891810-9819891","telephone":"520-555-1234","taxYear":2024,"countryCode":"US","email":"roadrunner@acmecorp.com","address":"1234 Meep Meep Blvd","city":"Tucson","state":"AZ","zip":"35004","foreignProvince":"1981981","transferAgentName":"test","lastFiling":false,"createdAt":"0001-01-01T00:00:00","updatedAt":"0001-01-01T00:00:00"}], + next_link: null +) +``` + diff --git a/docs/A1099/V2/PaginatedW9FormsModel.md b/docs/A1099/V2/PaginatedW9FormsModel.md new file mode 100644 index 0000000..cc31cc8 --- /dev/null +++ b/docs/A1099/V2/PaginatedW9FormsModel.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::PaginatedW9FormsModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recordset_count** | **Integer** | | [optional] | +| **value** | [**Array<IW9FormDataModelsOneOf>**](IW9FormDataModelsOneOf.md) | | [optional] | +| **next_link** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PaginatedW9FormsModel.new( + recordset_count: null, + value: [{"type":"w4","signedDate":"2022-04-29T00:00:00Z","createdAt":"2022-04-29T10:15:00Z","employeeFirstName":"Jane","employeeMiddleName":"A.","employeeLastName":"Smith","employeeNameSuffix":"Jr.","address":"456 Elm St","city":"Springfield","state":"IL","zip":"62704","typeOfTin":null,"tin":"98-7654321","box3MaritalStatus":"Married","box4LastNameDiffers":false,"box5NumAllowances":3,"otherDependents":1,"nonJobIncome":5000.0,"deductions":2000.0,"box6AdditionalWithheld":150.0,"box7ExemptFromWithholding":false,"officeCode":"OC12345","eDeliveryConsentedAt":"2022-04-29T15:00:00Z","id":0,"entryStatus":null,"updatedAt":"2022-05-01T12:00:00Z","referenceId":"REF56789","companyId":2002,"displayName":"Jane Smith","email":"janesmith@example.com","archived":false,"entryStatusDate":null,"pdfJson":null,"pdfVersion":null,"requestToken":null,"signature":null,"mobile":false,"appVersion":null,"platform":null,"osVersion":null,"ancestorId":null},{"type":"w8ben","signedDate":"2023-01-15T00:00:00Z","birthday":null,"foreignTinNotRequired":null,"archived":false,"referenceId":"REF67890","companyId":4004,"displayName":"International Trading","email":"info@internationaltrading.com","typeOfTin":null,"name":"International Trading Co.","residenceAddress":"789 Global St","residenceCity":"Capital City","residenceState":"DC","residencePostalCode":"20001","residenceCountry":"USA","residenceIsMailing":false,"mailingAddress":"P.O. Box 456","mailingCity":"Capital City","mailingState":"DC","mailingPostalCode":"20002","mailingCountry":"USA","tin":"34-5678901","foreignTin":"FTIN56789","referenceNumber":"W8BEN45678","citizenshipCountry":"USA","treatyCountry":"Canada","treatyArticle":"Article 12","withholdingRate":"15%","incomeType":"Dividend","treatyReasons":"Reduced withholding","signerName":"Alice Johnson","signerCapacity":"Authorized Representative","eDeliveryConsentedAt":"2023-01-15T10:00:00Z","createdAt":"2023-01-10T08:00:00Z","updatedAt":"2023-02-05T09:30:00Z","id":0,"entryStatus":null,"entryStatusDate":null,"pdfJson":null,"pdfVersion":null,"requestToken":null,"signature":null,"mobile":false,"appVersion":null,"platform":null,"osVersion":null,"ancestorId":null},{"type":"w8bene","signedDate":"2022-04-29T00:00:00Z","disregardedEntityChapter4FatcaStatus":null,"createdAt":"2022-04-29T10:00:00Z","name":"Global Enterprises LLC","residenceAddress":"123 International Blvd","residenceCity":"Metropolis","residenceState":"NY","residencePostalCode":"10118","residenceCountry":"USA","mailingAddress":"P.O. Box 123","mailingCity":"Metropolis","mailingState":"NY","mailingPostalCode":"10119","mailingCountry":"USA","disregardedAddress":null,"disregardedCity":null,"disregardedState":null,"disregardedPostalCode":null,"disregardedCountry":null,"tin":"12-3456789","typeOfTin":null,"foreignTin":null,"ftinNotRequired":null,"referenceNumber":"W8BENE12345","giin":"GIIN12345678","chapter3EntityType":"Corporation","chapter4FatcaStatus":"Active","disregardedEntity":"Subsidiary LLC","disregardedEntityGiin":"GIIN87654321","benefitLimitation":"Treaty Benefit","part4SponsoringEntity":"Parent Company","part4SponsoringEntityGiin":"GIIN11223344","part7SponsoringEntity":"Affiliated Organization","part12IgaCountry":"USA","part12IgaType":"Model 1","part12FatcaStatusUnderIgaAnnexIi":"Registered Deemed Compliant","part12TrusteeName":"Trustee Inc.","part12TrusteeIsForeign":false,"part12Model2IgaGiin":"GIIN33445566","box37AExchange":"NYSE","box37BExchange":"NASDAQ","box37BEntity":"Trading Partner","part28SponsoringEntity":"Global Trust","part28SponsoringEntityGiin":"GIIN99887766","signerName":"John Doe","eDeliveryConsentedAt":"2022-04-29T15:30:00Z","residenceIsMailing":false,"citizenshipCountry":null,"makingTreatyClaim":false,"treatyCountry":null,"treatyArticle":null,"withholdingRate":null,"incomeType":null,"treatyReasons":null,"certifyBox14A":false,"certifyBox14B":false,"certifyBox14C":false,"certifyBox17_1":false,"certifyBox17_2":false,"certifyBox18":false,"certifyBox19":false,"certifyBox21":false,"certifyBox22":false,"certifyBox23":false,"certifyBox24A":false,"certifyBox24B":false,"certifyBox24C":false,"certifyBox24D":false,"certifyBox25A":false,"certifyBox25B":false,"certifyBox25C":false,"certifyBox26":false,"certifyBox27":false,"certifyBox28A":false,"certifyBox28B":false,"certifyBox29A":false,"certifyBox29B":false,"certifyBox29C":false,"certifyBox29D":false,"certifyBox29E":false,"certifyBox29F":false,"certifyBox30":false,"certifyBox31":false,"certifyBox32":false,"certifyBox33":false,"certifyBox34":false,"certifyBox35":false,"certifyBox36":false,"certifyBox37A":false,"certifyBox37B":false,"certifyBox38":false,"certifyBox39":false,"certifyBox40A":false,"certifyBox40B":false,"certifyBox40C":false,"certifyBox41":false,"certifyBox43":false,"certifyPart29Signature":false,"part19FormationOrResolutionDate":null,"part20FilingDate":null,"part21DeterminationDate":null,"substantialUsOwners":[],"id":0,"entryStatus":null,"updatedAt":"2022-05-01T11:30:00Z","referenceId":"REF98765","companyId":3003,"displayName":"Global Enterprises","email":"contact@globalenterprises.com","archived":false,"entryStatusDate":null,"pdfJson":null,"pdfVersion":null,"requestToken":null,"signature":null,"mobile":false,"appVersion":null,"platform":null,"osVersion":null,"ancestorId":null},{"type":"w8imy","signedDate":"2023-06-10T00:00:00Z","disregardedEntityChapter4FatcaStatus":null,"createdAt":"2023-06-05T09:00:00Z","updatedAt":"2023-06-20T14:30:00Z","displayName":"Global Financials","email":"contact@globalfinancials.com","tin":null,"typeOfTin":null,"name":"Global Financials LLC","citizenshipCountry":"USA","chapter3EntityType":"Partnership","chapter4FatcaStatus":"Compliant","residenceAddress":"321 Wealth Ave","residenceCity":"Finance City","residenceState":"TX","residencePostalCode":"75001","residenceCountry":"USA","residenceIsMailing":false,"mailingAddress":"P.O. Box 789","mailingCity":"Finance City","mailingState":"TX","mailingPostalCode":"75002","mailingCountry":"USA","disregardedEntity":"Subsidiary Finance","disregardedAddress":null,"disregardedCity":null,"disregardedState":null,"disregardedPostalCode":null,"disregardedCountry":null,"disregardedEntityGiin":"GIIN78901234","ein":null,"einType":null,"giin":null,"foreignTin":null,"referenceNumber":"W8IMY56789","certifyBox14":false,"certifyBox15A":false,"certifyBox15B":false,"certifyBox15C":false,"certifyBox15D":false,"certifyBox15E":false,"certifyBox15F":false,"certifyBox15G":false,"certifyBox15H":false,"certifyBox15I":false,"certifyBox16A":false,"box16BQddCorporate":false,"box16BQddPartnership":false,"box16BQddDisregardedEntity":false,"certifyBox17A":false,"certifyBox17B":false,"certifyBox17C":false,"certifyBox17D":false,"certifyBox17E":false,"certifyBox18A":false,"certifyBox18B":false,"certifyBox18C":false,"certifyBox18D":false,"certifyBox18E":false,"certifyBox18F":false,"certifyBox19A":false,"certifyBox19B":false,"certifyBox19C":false,"certifyBox19D":false,"certifyBox19E":false,"certifyBox19F":false,"certifyBox20":false,"certifyBox21A":false,"certifyBox21B":false,"certifyBox21C":false,"certifyBox21D":false,"certifyBox21E":false,"certifyBox21F":false,"certifyBox22":false,"box23ANameSponsoringEntity":null,"certifyBox23B":false,"certifyBox23C":false,"certifyBox24A":false,"certifyBox24B":false,"certifyBox24C":false,"certifyBox25":false,"certifyBox26":false,"box27ANameSponsoringEntity":null,"certifyBox27B":false,"certifyBox28":false,"certifyBox29":false,"certifyBox30A":false,"certifyBox30B":false,"certifyBox30C":false,"certifyBox31":false,"certifyBox32":false,"box32IgaCountry":null,"box32IgaType":null,"box32IgaTreatedAs":null,"box32TrusteeOrSponsor":null,"box32TrusteeIsForeign":false,"certifyBox33A":false,"certifyBox33B":false,"certifyBox33C":false,"certifyBox33D":false,"certifyBox33E":false,"certifyBox33F":false,"certifyBox34":false,"certifyBox35":false,"certifyBox36":false,"certifyBox37A":false,"box37ASecuritiesMarket":null,"certifyBox37B":false,"box37BNameOfEntity":null,"box37BSecuritiesMarket":null,"certifyBox38":false,"certifyBox39":false,"certifyBox40":false,"box41SponsoringEntity":null,"certifyBox42":false,"signerName":"Richard Roe","eDeliveryConsentedAt":"2023-06-10T11:00:00Z","box35FormedOnDate":null,"box36FiledOnDate":null,"id":0,"entryStatus":null,"referenceId":"REF12345","companyId":5005,"archived":false,"entryStatusDate":null,"pdfJson":null,"pdfVersion":null,"requestToken":null,"signature":null,"mobile":false,"appVersion":null,"platform":null,"osVersion":null,"ancestorId":null},{"type":"w9","tinMatchStatus":"Match","signature":null,"signedDate":"2022-04-29T15:19:42Z","name":"John Doe","businessClassification":"LLC","businessName":"Doe Enterprises","businessOther":null,"exemptPayeeCode":null,"exemptFatcaCode":null,"typeOfTin":"EIN","tin":"12-3456789","address":"123 Main St","city":"Anytown","state":"CA","zip":"90210","accountNumber":"ACC123456","foreignCountryIndicator":false,"foreignAddress":null,"backupWithholding":false,"eDeliveryConsentedAt":"2022-04-29T15:19:42Z","is1099able":null,"foreignPartnerOwnerOrBeneficiary":false,"createdAt":"2022-04-29T15:19:42Z","id":0,"entryStatus":null,"updatedAt":"2022-04-29T15:19:42Z","referenceId":"REF12345","companyId":1001,"displayName":"John Doe","email":"johndoe@example.com","archived":false,"entryStatusDate":null,"pdfJson":null,"pdfVersion":null,"requestToken":null,"mobile":false,"appVersion":null,"platform":null,"osVersion":null,"ancestorId":null}], + next_link: null +) +``` + diff --git a/docs/A1099/V2/ProblemDetails.md b/docs/A1099/V2/ProblemDetails.md new file mode 100644 index 0000000..9c12afe --- /dev/null +++ b/docs/A1099/V2/ProblemDetails.md @@ -0,0 +1,26 @@ +# AvalaraSdk::A1099::V2::ProblemDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | [optional] | +| **title** | **String** | | [optional] | +| **status** | **Integer** | | [optional] | +| **detail** | **String** | | [optional] | +| **instance** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::ProblemDetails.new( + type: null, + title: null, + status: null, + detail: null, + instance: null +) +``` + diff --git a/docs/A1099/V2/StateAndLocalWithholding.md b/docs/A1099/V2/StateAndLocalWithholding.md new file mode 100644 index 0000000..0ef3cef --- /dev/null +++ b/docs/A1099/V2/StateAndLocalWithholding.md @@ -0,0 +1,32 @@ +# AvalaraSdk::A1099::V2::StateAndLocalWithholding + +## Properties + +| 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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::StateAndLocalWithholding.new( + state_tax_withheld: null, + state: null, + state_id_number: null, + state_income: null, + local_tax_withheld: null, + locality: null, + locality_id_number: null, + local_income: null +) +``` + diff --git a/docs/A1099/V2/StateAndLocalWithholdingRequest.md b/docs/A1099/V2/StateAndLocalWithholdingRequest.md new file mode 100644 index 0000000..91df55c --- /dev/null +++ b/docs/A1099/V2/StateAndLocalWithholdingRequest.md @@ -0,0 +1,32 @@ +# AvalaraSdk::A1099::V2::StateAndLocalWithholdingRequest + +## Properties + +| 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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::StateAndLocalWithholdingRequest.new( + state_tax_withheld: null, + state: null, + state_id_number: null, + state_income: null, + local_tax_withheld: null, + locality: null, + locality_id_number: null, + local_income: null +) +``` + diff --git a/docs/A1099/V2/StateEfileStatusDetail.md b/docs/A1099/V2/StateEfileStatusDetail.md new file mode 100644 index 0000000..7deaa9f --- /dev/null +++ b/docs/A1099/V2/StateEfileStatusDetail.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::StateEfileStatusDetail + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | | [optional] | +| **time** | **String** | | [optional] | +| **jurisdiction** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::StateEfileStatusDetail.new( + status: accepted, + time: null, + jurisdiction: null +) +``` + diff --git a/docs/A1099/V2/SubstantialUsOwnerResponse.md b/docs/A1099/V2/SubstantialUsOwnerResponse.md new file mode 100644 index 0000000..2899b76 --- /dev/null +++ b/docs/A1099/V2/SubstantialUsOwnerResponse.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::SubstantialUsOwnerResponse + +## 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::SubstantialUsOwnerResponse.new( + name: null, + address: null, + tin: null +) +``` + diff --git a/docs/A1099/V2/ValidationError.md b/docs/A1099/V2/ValidationError.md new file mode 100644 index 0000000..d904db3 --- /dev/null +++ b/docs/A1099/V2/ValidationError.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::ValidationError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **field** | **String** | | [optional] | +| **errors** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::ValidationError.new( + field: null, + errors: null +) +``` + diff --git a/docs/A1099/V2/W4FormDataModel.md b/docs/A1099/V2/W4FormDataModel.md new file mode 100644 index 0000000..42733c5 --- /dev/null +++ b/docs/A1099/V2/W4FormDataModel.md @@ -0,0 +1,440 @@ +# AvalaraSdk::A1099::V2::W4FormDataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of the form, always W4 for this model. | [optional][readonly] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [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] | +| **employee_name_suffix** | **String** | The name suffix of the employee. | [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] | +| **type_of_tin** | **String** | The type of TIN provided. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN) of the employee. | [optional] | +| **box3_marital_status** | **String** | The marital status of the employee. | [optional] | +| **box4_last_name_differs** | **Boolean** | Indicates whether the last name differs from prior records. | [optional] | +| **box5_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] | +| **box6_additional_withheld** | **Float** | The additional amount withheld. | [optional] | +| **box7_exempt_from_withholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | +| **office_code** | **String** | The office code associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **disregarded_entity_chapter4_fatca_status** | **String** | The FATCA status for disregarded entities under Chapter 4. | [optional] | +| **name** | **String** | The name of the individual or entity associated with the form. | [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_postal_code** | **String** | The postal code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [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_postal_code** | **String** | The postal code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [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_postal_code** | **String** | The postal code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **foreign_tin** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **ftin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **giin** | **String** | The global intermediary identification number (GIIN). | [optional] | +| **chapter3_entity_type** | **String** | The Chapter 3 entity type. | [optional] | +| **chapter4_fatca_status** | **String** | The Chapter 4 FATCA status. | [optional] | +| **disregarded_entity** | **String** | The disregarded entity information. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **benefit_limitation** | **String** | The benefit limitation for tax treaty claims. | [optional] | +| **part4_sponsoring_entity** | **String** | The sponsoring entity information for Part 4. | [optional] | +| **part4_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 4. | [optional] | +| **part7_sponsoring_entity** | **String** | The sponsoring entity information for Part 7. | [optional] | +| **part12_iga_country** | **String** | The IGA country information for Part 12. | [optional] | +| **part12_iga_type** | **String** | The IGA type information for Part 12. | [optional] | +| **part12_fatca_status_under_iga_annex_ii** | **String** | The FATCA status under IGA Annex II for Part 12. | [optional] | +| **part12_trustee_name** | **String** | The trustee name for Part 12. | [optional] | +| **part12_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for Part 12. | [optional] | +| **part12_model2_iga_giin** | **String** | The GIIN for Model 2 IGA in Part 12. | [optional] | +| **box37_a_exchange** | **String** | The exchange information for Box 37A. | [optional] | +| **box37_b_exchange** | **String** | The exchange information for Box 37B. | [optional] | +| **box37_b_entity** | **String** | The entity information for Box 37B. | [optional] | +| **part28_sponsoring_entity** | **String** | The sponsoring entity information for Part 28. | [optional] | +| **part28_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 28. | [optional] | +| **signer_name** | **String** | The name of the signer of the form. | [optional] | +| **residence_is_mailing** | **Boolean** | Indicates whether the residence address is also the mailing address. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **making_treaty_claim** | **Boolean** | | [optional] | +| **treaty_country** | **String** | The country for which the treaty applies. | [optional] | +| **treaty_article** | **String** | The specific article of the treaty being claimed. | [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] | +| **treaty_reasons** | **String** | The reasons for claiming treaty benefits. | [optional] | +| **certify_box14_a** | **Boolean** | | [optional] | +| **certify_box14_b** | **Boolean** | | [optional] | +| **certify_box14_c** | **Boolean** | | [optional] | +| **certify_box17_1** | **Boolean** | | [optional] | +| **certify_box17_2** | **Boolean** | | [optional] | +| **certify_box18** | **Boolean** | | [optional] | +| **certify_box19** | **Boolean** | | [optional] | +| **certify_box21** | **Boolean** | | [optional] | +| **certify_box22** | **Boolean** | Indicates certification for box 22. | [optional] | +| **certify_box23** | **Boolean** | | [optional] | +| **certify_box24_a** | **Boolean** | Indicates certification for box 24A. | [optional] | +| **certify_box24_b** | **Boolean** | Indicates certification for box 24B. | [optional] | +| **certify_box24_c** | **Boolean** | Indicates certification for box 24C. | [optional] | +| **certify_box24_d** | **Boolean** | | [optional] | +| **certify_box25_a** | **Boolean** | | [optional] | +| **certify_box25_b** | **Boolean** | | [optional] | +| **certify_box25_c** | **Boolean** | | [optional] | +| **certify_box26** | **Boolean** | Indicates certification for box 26. | [optional] | +| **certify_box27** | **Boolean** | | [optional] | +| **certify_box28_a** | **Boolean** | | [optional] | +| **certify_box28_b** | **Boolean** | | [optional] | +| **certify_box29_a** | **Boolean** | | [optional] | +| **certify_box29_b** | **Boolean** | | [optional] | +| **certify_box29_c** | **Boolean** | | [optional] | +| **certify_box29_d** | **Boolean** | | [optional] | +| **certify_box29_e** | **Boolean** | | [optional] | +| **certify_box29_f** | **Boolean** | | [optional] | +| **certify_box30** | **Boolean** | | [optional] | +| **certify_box31** | **Boolean** | Indicates certification for box 31. | [optional] | +| **certify_box32** | **Boolean** | Indicates certification for box 32. | [optional] | +| **certify_box33** | **Boolean** | | [optional] | +| **certify_box34** | **Boolean** | Indicates certification for box 34. | [optional] | +| **certify_box35** | **Boolean** | Indicates certification for box 35. | [optional] | +| **certify_box36** | **Boolean** | Indicates certification for box 36. | [optional] | +| **certify_box37_a** | **Boolean** | Indicates certification for box 37A. | [optional] | +| **certify_box37_b** | **Boolean** | Indicates certification for box 37B. | [optional] | +| **certify_box38** | **Boolean** | Indicates certification for box 38. | [optional] | +| **certify_box39** | **Boolean** | Indicates certification for box 39. | [optional] | +| **certify_box40_a** | **Boolean** | | [optional] | +| **certify_box40_b** | **Boolean** | | [optional] | +| **certify_box40_c** | **Boolean** | | [optional] | +| **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] | +| **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] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **Integer** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **signer_capacity** | **String** | The capacity in which the signer is signing the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | +| **ein** | **String** | The employer identification number (EIN). | [optional] | +| **ein_type** | **String** | The type of employer identification number (EIN). | [optional] | +| **certify_box14** | **Boolean** | Indicates certification for box 14. | [optional] | +| **certify_box15_a** | **Boolean** | Indicates certification for box 15A. | [optional] | +| **certify_box15_b** | **Boolean** | Indicates certification for box 15B. | [optional] | +| **certify_box15_c** | **Boolean** | Indicates certification for box 15C. | [optional] | +| **certify_box15_d** | **Boolean** | Indicates certification for box 15D. | [optional] | +| **certify_box15_e** | **Boolean** | Indicates certification for box 15E. | [optional] | +| **certify_box15_f** | **Boolean** | Indicates certification for box 15F. | [optional] | +| **certify_box15_g** | **Boolean** | Indicates certification for box 15G. | [optional] | +| **certify_box15_h** | **Boolean** | Indicates certification for box 15H. | [optional] | +| **certify_box15_i** | **Boolean** | Indicates certification for box 15I. | [optional] | +| **certify_box16_a** | **Boolean** | Indicates certification for box 16A. | [optional] | +| **box16_b_qdd_corporate** | **Boolean** | Indicates certification for box 16B as a QDD corporate entity. | [optional] | +| **box16_b_qdd_partnership** | **Boolean** | Indicates certification for box 16B as a QDD partnership. | [optional] | +| **box16_b_qdd_disregarded_entity** | **Boolean** | Indicates certification for box 16B as a QDD disregarded entity. | [optional] | +| **certify_box17_a** | **Boolean** | Indicates certification for box 17A. | [optional] | +| **certify_box17_b** | **Boolean** | Indicates certification for box 17B. | [optional] | +| **certify_box17_c** | **Boolean** | Indicates certification for box 17C. | [optional] | +| **certify_box17_d** | **Boolean** | Indicates certification for box 17D. | [optional] | +| **certify_box17_e** | **Boolean** | Indicates certification for box 17E. | [optional] | +| **certify_box18_a** | **Boolean** | Indicates certification for box 18A. | [optional] | +| **certify_box18_b** | **Boolean** | Indicates certification for box 18B. | [optional] | +| **certify_box18_c** | **Boolean** | Indicates certification for box 18C. | [optional] | +| **certify_box18_d** | **Boolean** | Indicates certification for box 18D. | [optional] | +| **certify_box18_e** | **Boolean** | Indicates certification for box 18E. | [optional] | +| **certify_box18_f** | **Boolean** | Indicates certification for box 18F. | [optional] | +| **certify_box19_a** | **Boolean** | Indicates certification for box 19A. | [optional] | +| **certify_box19_b** | **Boolean** | Indicates certification for box 19B. | [optional] | +| **certify_box19_c** | **Boolean** | Indicates certification for box 19C. | [optional] | +| **certify_box19_d** | **Boolean** | Indicates certification for box 19D. | [optional] | +| **certify_box19_e** | **Boolean** | Indicates certification for box 19E. | [optional] | +| **certify_box19_f** | **Boolean** | Indicates certification for box 19F. | [optional] | +| **certify_box20** | **Boolean** | Indicates certification for box 20. | [optional] | +| **certify_box21_a** | **Boolean** | Indicates certification for box 21A. | [optional] | +| **certify_box21_b** | **Boolean** | Indicates certification for box 21B. | [optional] | +| **certify_box21_c** | **Boolean** | Indicates certification for box 21C. | [optional] | +| **certify_box21_d** | **Boolean** | Indicates certification for box 21D. | [optional] | +| **certify_box21_e** | **Boolean** | Indicates certification for box 21E. | [optional] | +| **certify_box21_f** | **Boolean** | Indicates certification for box 21F. | [optional] | +| **box23_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 23A. | [optional] | +| **certify_box23_b** | **Boolean** | Indicates certification for box 23B. | [optional] | +| **certify_box23_c** | **Boolean** | Indicates certification for box 23C. | [optional] | +| **certify_box25** | **Boolean** | Indicates certification for box 25. | [optional] | +| **box27_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 27A. | [optional] | +| **certify_box27_b** | **Boolean** | Indicates certification for box 27B. | [optional] | +| **certify_box28** | **Boolean** | Indicates certification for box 28. | [optional] | +| **certify_box29** | **Boolean** | Indicates certification for box 29. | [optional] | +| **certify_box30_a** | **Boolean** | Indicates certification for box 30A. | [optional] | +| **certify_box30_b** | **Boolean** | Indicates certification for box 30B. | [optional] | +| **certify_box30_c** | **Boolean** | Indicates certification for box 30C. | [optional] | +| **box32_iga_country** | **String** | The IGA country information for box 32. | [optional] | +| **box32_iga_type** | **String** | The IGA type information for box 32. | [optional] | +| **box32_iga_treated_as** | **String** | The IGA treatment information for box 32. | [optional] | +| **box32_trustee_or_sponsor** | **String** | The trustee or sponsor information for box 32. | [optional] | +| **box32_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for box 32. | [optional] | +| **certify_box33_a** | **Boolean** | Indicates certification for box 33A. | [optional] | +| **certify_box33_b** | **Boolean** | Indicates certification for box 33B. | [optional] | +| **certify_box33_c** | **Boolean** | Indicates certification for box 33C. | [optional] | +| **certify_box33_d** | **Boolean** | Indicates certification for box 33D. | [optional] | +| **certify_box33_e** | **Boolean** | Indicates certification for box 33E. | [optional] | +| **certify_box33_f** | **Boolean** | Indicates certification for box 33F. | [optional] | +| **box37_a_securities_market** | **String** | The securities market information for box 37A. | [optional] | +| **box37_b_name_of_entity** | **String** | The name of the entity for box 37B. | [optional] | +| **box37_b_securities_market** | **String** | The securities market information for box 37B. | [optional] | +| **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] | +| **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] | +| **business_name** | **String** | The name of the business associated with the form. | [optional] | +| **business_other** | **String** | | [optional] | +| **exempt_payee_code** | **String** | | [optional] | +| **exempt_fatca_code** | **String** | | [optional] | +| **account_number** | **String** | The account number associated with the form. | [optional] | +| **foreign_country_indicator** | **Boolean** | Indicates whether the individual or entity is in a foreign country. | [optional] | +| **foreign_address** | **String** | The foreign address of the individual or entity. | [optional] | +| **backup_withholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | +| **is1099able** | **Boolean** | | [optional] | +| **foreign_partner_owner_or_beneficiary** | **Boolean** | Indicates whether the individual is a foreign partner, owner, or beneficiary. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W4FormDataModel.new( + type: w4, + signed_date: 2022-04-29T00:00Z, + created_at: 2022-04-29T10:15Z, + employee_first_name: Jane, + employee_middle_name: A., + employee_last_name: Smith, + employee_name_suffix: Jr., + address: 456 Elm St, + city: Springfield, + state: IL, + zip: 62704, + type_of_tin: null, + tin: 98-7654321, + box3_marital_status: Married, + box4_last_name_differs: false, + box5_num_allowances: 3, + other_dependents: 1, + non_job_income: 5000.0, + deductions: 2000.0, + box6_additional_withheld: 150.0, + box7_exempt_from_withholding: false, + office_code: OC12345, + e_delivery_consented_at: 2022-04-29T15:00Z, + disregarded_entity_chapter4_fatca_status: null, + name: John Doe, + residence_address: 321 Wealth Ave, + residence_city: Finance City, + residence_state: TX, + residence_postal_code: 75001, + residence_country: USA, + mailing_address: P.O. Box 789, + mailing_city: Finance City, + mailing_state: TX, + mailing_postal_code: 75002, + mailing_country: USA, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_postal_code: null, + disregarded_country: null, + foreign_tin: null, + ftin_not_required: null, + reference_number: W8IMY56789, + giin: null, + chapter3_entity_type: Partnership, + chapter4_fatca_status: Compliant, + disregarded_entity: Subsidiary Finance, + disregarded_entity_giin: GIIN78901234, + benefit_limitation: Treaty Benefit, + part4_sponsoring_entity: Parent Company, + part4_sponsoring_entity_giin: GIIN11223344, + part7_sponsoring_entity: Affiliated Organization, + part12_iga_country: USA, + part12_iga_type: Model 1, + part12_fatca_status_under_iga_annex_ii: Registered Deemed Compliant, + part12_trustee_name: Trustee Inc., + part12_trustee_is_foreign: false, + part12_model2_iga_giin: GIIN33445566, + box37_a_exchange: NYSE, + box37_b_exchange: NASDAQ, + box37_b_entity: Trading Partner, + part28_sponsoring_entity: Global Trust, + part28_sponsoring_entity_giin: GIIN99887766, + signer_name: Richard Roe, + residence_is_mailing: false, + citizenship_country: USA, + making_treaty_claim: false, + treaty_country: Canada, + treaty_article: Article 12, + withholding_rate: 15%, + income_type: Dividend, + treaty_reasons: Reduced withholding, + certify_box14_a: false, + certify_box14_b: false, + certify_box14_c: false, + certify_box17_1: false, + certify_box17_2: false, + certify_box18: false, + certify_box19: false, + certify_box21: false, + certify_box22: false, + certify_box23: false, + certify_box24_a: false, + certify_box24_b: false, + certify_box24_c: false, + certify_box24_d: false, + certify_box25_a: false, + certify_box25_b: false, + certify_box25_c: false, + certify_box26: false, + certify_box27: false, + certify_box28_a: false, + certify_box28_b: false, + certify_box29_a: false, + certify_box29_b: false, + certify_box29_c: false, + certify_box29_d: false, + certify_box29_e: false, + certify_box29_f: false, + certify_box30: false, + certify_box31: false, + certify_box32: false, + certify_box33: false, + certify_box34: false, + certify_box35: false, + certify_box36: false, + certify_box37_a: false, + certify_box37_b: false, + certify_box38: false, + certify_box39: false, + certify_box40_a: false, + certify_box40_b: false, + certify_box40_c: false, + certify_box41: false, + certify_box43: false, + certify_part29_signature: false, + part19_formation_or_resolution_date: null, + part20_filing_date: null, + part21_determination_date: null, + substantial_us_owners: [], + birthday: null, + foreign_tin_not_required: null, + archived: false, + reference_id: REF67890, + company_id: 4004, + display_name: Global Financials, + email: contact@globalfinancials.com, + signer_capacity: Authorized Representative, + updated_at: 2023-06-20T14:30Z, + ein: null, + ein_type: null, + certify_box14: false, + certify_box15_a: false, + certify_box15_b: false, + certify_box15_c: false, + certify_box15_d: false, + certify_box15_e: false, + certify_box15_f: false, + certify_box15_g: false, + certify_box15_h: false, + certify_box15_i: false, + certify_box16_a: false, + box16_b_qdd_corporate: false, + box16_b_qdd_partnership: false, + box16_b_qdd_disregarded_entity: false, + certify_box17_a: false, + certify_box17_b: false, + certify_box17_c: false, + certify_box17_d: false, + certify_box17_e: false, + certify_box18_a: false, + certify_box18_b: false, + certify_box18_c: false, + certify_box18_d: false, + certify_box18_e: false, + certify_box18_f: false, + certify_box19_a: false, + certify_box19_b: false, + certify_box19_c: false, + certify_box19_d: false, + certify_box19_e: false, + certify_box19_f: false, + certify_box20: false, + certify_box21_a: false, + certify_box21_b: false, + certify_box21_c: false, + certify_box21_d: false, + certify_box21_e: false, + certify_box21_f: false, + box23_a_name_sponsoring_entity: null, + certify_box23_b: false, + certify_box23_c: false, + certify_box25: false, + box27_a_name_sponsoring_entity: null, + certify_box27_b: false, + certify_box28: false, + certify_box29: false, + certify_box30_a: false, + certify_box30_b: false, + certify_box30_c: false, + box32_iga_country: null, + box32_iga_type: null, + box32_iga_treated_as: null, + box32_trustee_or_sponsor: null, + box32_trustee_is_foreign: false, + certify_box33_a: false, + certify_box33_b: false, + certify_box33_c: false, + certify_box33_d: false, + certify_box33_e: false, + certify_box33_f: false, + box37_a_securities_market: null, + box37_b_name_of_entity: null, + box37_b_securities_market: null, + certify_box40: false, + box41_sponsoring_entity: null, + certify_box42: false, + box35_formed_on_date: null, + box36_filed_on_date: null, + tin_match_status: Match, + signature: null, + business_classification: LLC, + business_name: Doe Enterprises, + business_other: null, + exempt_payee_code: null, + exempt_fatca_code: null, + account_number: ACC123456, + foreign_country_indicator: false, + foreign_address: null, + backup_withholding: false, + is1099able: null, + foreign_partner_owner_or_beneficiary: false +) +``` + diff --git a/docs/A1099/V2/W4FormResponse.md b/docs/A1099/V2/W4FormResponse.md new file mode 100644 index 0000000..208486a --- /dev/null +++ b/docs/A1099/V2/W4FormResponse.md @@ -0,0 +1,82 @@ +# AvalaraSdk::A1099::V2::W4FormResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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] | +| **id** | **String** | The unique identifier for the form. | [optional] | +| **type** | **String** | The form type. | [optional] | +| **entry_status** | **String** | The form status. | [optional] | +| **entry_status_date** | **Time** | The timestamp for the latest status update. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W4FormResponse.new( + employee_first_name: Jane, + employee_middle_name: A., + employee_last_name: Smith, + employee_name_suffix: Jr., + tin_type: SSN, + tin: 123-45-6789, + address: 456 Elm St, + city: Springfield, + state: IL, + zip: 62704, + marital_status: Married, + last_name_differs: false, + num_allowances: 3, + other_dependents: 1, + non_job_income: 5000, + deductions: 2000, + additional_withheld: 150, + exempt_from_withholding: false, + office_code: OC12345, + id: null, + type: null, + entry_status: null, + entry_status_date: null, + reference_id: null, + company_id: null, + display_name: null, + email: null, + archived: null, + signature: null, + signed_date: null, + e_delivery_consented_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/W8BenEFormResponse.md b/docs/A1099/V2/W8BenEFormResponse.md new file mode 100644 index 0000000..f260758 --- /dev/null +++ b/docs/A1099/V2/W8BenEFormResponse.md @@ -0,0 +1,236 @@ +# AvalaraSdk::A1099::V2::W8BenEFormResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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_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_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** | **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] | +| **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] | +| **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] | +| **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<SubstantialUsOwnerResponse>**](SubstantialUsOwnerResponse.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] | +| **id** | **String** | The unique identifier for the form. | [optional] | +| **type** | **String** | The form type. | [optional] | +| **entry_status** | **String** | The form status. | [optional] | +| **entry_status_date** | **Time** | The timestamp for the latest status update. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BenEFormResponse.new( + name: Global Enterprises LLC, + citizenship_country: USA, + disregarded_entity: Subsidiary LLC, + entity_type: Corporation, + making_treaty_claim: false, + fatca_status: Active, + residence_address: 123 International Blvd, + residence_city: Metropolis, + residence_state: NY, + residence_zip: 10118, + residence_country: USA, + residence_is_mailing: false, + mailing_address: P.O. Box 123, + mailing_city: Metropolis, + mailing_state: NY, + mailing_zip: 10119, + mailing_country: USA, + tin_type: , + tin: 123-45-6789, + giin: GIIN12345678, + foreign_tin_not_required: true, + foreign_tin: null, + reference_number: W8BENE12345, + 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: false, + treaty_country: null, + benefit_limitation_certification: false, + benefit_limitation: null, + qualified_resident_status_certification: false, + treaty_article: null, + withholding_rate: null, + income_type: null, + treaty_reasons: null, + ffi_sponsoring_entity: null, + investment_entity_certification: false, + controlled_foreign_corporation_certification: false, + compliant_nonregistering_local_bank_certification: false, + compliant_ffi_low_value_accounts_certification: false, + sponsored_closely_held_entity_sponsoring_entity: null, + sponsored_closely_held_investment_vehicle_certification: false, + compliant_limited_life_debt_entity_certification: false, + investment_entity_no_financial_accounts_certification: false, + owner_documented_ffi_certification: false, + owner_documented_ffi_reporting_statement_certification: false, + owner_documented_ffi_auditor_letter_certification: false, + owner_documented_ffi_trust_beneficiaries_certification: false, + restricted_distributor_certification: false, + restricted_distributor_agreement_certification: false, + restricted_distributor_preexisting_sales_compliance_certification: false, + nonreporting_iga_ffi_certification: false, + 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: false, + internation_organization_certification: false, + intergovernmental_organization_certification: false, + treaty_qualified_pension_fund_certification: false, + qualified_retirement_fund_certification: false, + narrow_participation_retirement_fund_certification: false, + section401_a_equivalent_pension_plan_certification: false, + investment_entity_for_retirement_funds_certification: false, + exempt_beneficial_owner_sponsored_retirement_fund_certification: false, + exempt_beneficial_owner_owned_investment_entity_certification: false, + territory_financial_institution_certification: false, + excepted_nonfinancial_group_entity_certification: false, + excepted_nonfinancial_start_up_certification: false, + startup_formation_or_resolution_date: null, + excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification: false, + nonfinancial_entity_filing_date: null, + section501_c_organization_certification: false, + determination_letter_date: null, + nonprofit_organization_certification: false, + publicly_traded_nffe_certification: false, + publicly_traded_nffe_securities_market: null, + nffe_affiliate_of_publicly_traded_entity_certification: false, + publicly_traded_entity: null, + nffe_affiliate_of_publicly_traded_entity_securities_market: null, + excepted_territory_nffe_certification: false, + active_nffe_certification: false, + passive_nffe_certification: false, + passive_nffe_no_substantial_us_owners_certification: false, + passive_nffe_substantial_us_owners_provided_certification: false, + excepted_inter_affiliate_ffi_certification: false, + sponsored_direct_reporting_nffe_certification: false, + direct_reporting_nffe_sponsoring_entity: null, + substantial_us_owners: [], + signer_name: null, + capacity_to_sign_certification: false, + id: null, + type: null, + entry_status: null, + entry_status_date: null, + reference_id: null, + company_id: null, + display_name: null, + email: null, + archived: null, + signature: null, + signed_date: null, + e_delivery_consented_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md b/docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md new file mode 100644 index 0000000..afb2cf9 --- /dev/null +++ b/docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::W8BenESubstantialUsOwnerDataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **tin** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BenESubstantialUsOwnerDataModel.new( + name: null, + address: null, + tin: null +) +``` + diff --git a/docs/A1099/V2/W8BenFormDataModel.md b/docs/A1099/V2/W8BenFormDataModel.md new file mode 100644 index 0000000..99236c7 --- /dev/null +++ b/docs/A1099/V2/W8BenFormDataModel.md @@ -0,0 +1,440 @@ +# AvalaraSdk::A1099::V2::W8BenFormDataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of the form, always W8ben for this model. | [optional][readonly] | +| **signed_date** | **Time** | The date the form was signed. | [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] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **Integer** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **type_of_tin** | **String** | The type of TIN provided. | [optional] | +| **name** | **String** | The name of the individual or entity associated with the form. | [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_postal_code** | **String** | The postal code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [optional] | +| **residence_is_mailing** | **Boolean** | | [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_postal_code** | **String** | The postal 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** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **treaty_country** | **String** | The country for which the treaty applies. | [optional] | +| **treaty_article** | **String** | The specific article of the treaty being claimed. | [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] | +| **treaty_reasons** | **String** | The reasons for claiming treaty benefits. | [optional] | +| **signer_name** | **String** | The name of the signer of the form. | [optional] | +| **signer_capacity** | **String** | The capacity in which the signer is signing the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [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] | +| **employee_name_suffix** | **String** | The name suffix of the employee. | [optional] | +| **address** | **String** | The 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] | +| **box3_marital_status** | **String** | The marital status of the employee. | [optional] | +| **box4_last_name_differs** | **Boolean** | Indicates whether the last name differs from prior records. | [optional] | +| **box5_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] | +| **box6_additional_withheld** | **Float** | The additional amount withheld. | [optional] | +| **box7_exempt_from_withholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | +| **office_code** | **String** | The office code associated with the form. | [optional] | +| **disregarded_entity_chapter4_fatca_status** | **String** | The FATCA status for disregarded entities under Chapter 4. | [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_postal_code** | **String** | The postal code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **ftin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | +| **giin** | **String** | The global intermediary identification number (GIIN). | [optional] | +| **chapter3_entity_type** | **String** | The Chapter 3 entity type. | [optional] | +| **chapter4_fatca_status** | **String** | The Chapter 4 FATCA status. | [optional] | +| **disregarded_entity** | **String** | The disregarded entity information. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **benefit_limitation** | **String** | The benefit limitation for tax treaty claims. | [optional] | +| **part4_sponsoring_entity** | **String** | The sponsoring entity information for Part 4. | [optional] | +| **part4_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 4. | [optional] | +| **part7_sponsoring_entity** | **String** | The sponsoring entity information for Part 7. | [optional] | +| **part12_iga_country** | **String** | The IGA country information for Part 12. | [optional] | +| **part12_iga_type** | **String** | The IGA type information for Part 12. | [optional] | +| **part12_fatca_status_under_iga_annex_ii** | **String** | The FATCA status under IGA Annex II for Part 12. | [optional] | +| **part12_trustee_name** | **String** | The trustee name for Part 12. | [optional] | +| **part12_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for Part 12. | [optional] | +| **part12_model2_iga_giin** | **String** | The GIIN for Model 2 IGA in Part 12. | [optional] | +| **box37_a_exchange** | **String** | The exchange information for Box 37A. | [optional] | +| **box37_b_exchange** | **String** | The exchange information for Box 37B. | [optional] | +| **box37_b_entity** | **String** | The entity information for Box 37B. | [optional] | +| **part28_sponsoring_entity** | **String** | The sponsoring entity information for Part 28. | [optional] | +| **part28_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 28. | [optional] | +| **making_treaty_claim** | **Boolean** | | [optional] | +| **certify_box14_a** | **Boolean** | | [optional] | +| **certify_box14_b** | **Boolean** | | [optional] | +| **certify_box14_c** | **Boolean** | | [optional] | +| **certify_box17_1** | **Boolean** | | [optional] | +| **certify_box17_2** | **Boolean** | | [optional] | +| **certify_box18** | **Boolean** | | [optional] | +| **certify_box19** | **Boolean** | | [optional] | +| **certify_box21** | **Boolean** | | [optional] | +| **certify_box22** | **Boolean** | Indicates certification for box 22. | [optional] | +| **certify_box23** | **Boolean** | | [optional] | +| **certify_box24_a** | **Boolean** | Indicates certification for box 24A. | [optional] | +| **certify_box24_b** | **Boolean** | Indicates certification for box 24B. | [optional] | +| **certify_box24_c** | **Boolean** | Indicates certification for box 24C. | [optional] | +| **certify_box24_d** | **Boolean** | | [optional] | +| **certify_box25_a** | **Boolean** | | [optional] | +| **certify_box25_b** | **Boolean** | | [optional] | +| **certify_box25_c** | **Boolean** | | [optional] | +| **certify_box26** | **Boolean** | Indicates certification for box 26. | [optional] | +| **certify_box27** | **Boolean** | | [optional] | +| **certify_box28_a** | **Boolean** | | [optional] | +| **certify_box28_b** | **Boolean** | | [optional] | +| **certify_box29_a** | **Boolean** | | [optional] | +| **certify_box29_b** | **Boolean** | | [optional] | +| **certify_box29_c** | **Boolean** | | [optional] | +| **certify_box29_d** | **Boolean** | | [optional] | +| **certify_box29_e** | **Boolean** | | [optional] | +| **certify_box29_f** | **Boolean** | | [optional] | +| **certify_box30** | **Boolean** | | [optional] | +| **certify_box31** | **Boolean** | Indicates certification for box 31. | [optional] | +| **certify_box32** | **Boolean** | Indicates certification for box 32. | [optional] | +| **certify_box33** | **Boolean** | | [optional] | +| **certify_box34** | **Boolean** | Indicates certification for box 34. | [optional] | +| **certify_box35** | **Boolean** | Indicates certification for box 35. | [optional] | +| **certify_box36** | **Boolean** | Indicates certification for box 36. | [optional] | +| **certify_box37_a** | **Boolean** | Indicates certification for box 37A. | [optional] | +| **certify_box37_b** | **Boolean** | Indicates certification for box 37B. | [optional] | +| **certify_box38** | **Boolean** | Indicates certification for box 38. | [optional] | +| **certify_box39** | **Boolean** | Indicates certification for box 39. | [optional] | +| **certify_box40_a** | **Boolean** | | [optional] | +| **certify_box40_b** | **Boolean** | | [optional] | +| **certify_box40_c** | **Boolean** | | [optional] | +| **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] | +| **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] | +| **certify_box14** | **Boolean** | Indicates certification for box 14. | [optional] | +| **certify_box15_a** | **Boolean** | Indicates certification for box 15A. | [optional] | +| **certify_box15_b** | **Boolean** | Indicates certification for box 15B. | [optional] | +| **certify_box15_c** | **Boolean** | Indicates certification for box 15C. | [optional] | +| **certify_box15_d** | **Boolean** | Indicates certification for box 15D. | [optional] | +| **certify_box15_e** | **Boolean** | Indicates certification for box 15E. | [optional] | +| **certify_box15_f** | **Boolean** | Indicates certification for box 15F. | [optional] | +| **certify_box15_g** | **Boolean** | Indicates certification for box 15G. | [optional] | +| **certify_box15_h** | **Boolean** | Indicates certification for box 15H. | [optional] | +| **certify_box15_i** | **Boolean** | Indicates certification for box 15I. | [optional] | +| **certify_box16_a** | **Boolean** | Indicates certification for box 16A. | [optional] | +| **box16_b_qdd_corporate** | **Boolean** | Indicates certification for box 16B as a QDD corporate entity. | [optional] | +| **box16_b_qdd_partnership** | **Boolean** | Indicates certification for box 16B as a QDD partnership. | [optional] | +| **box16_b_qdd_disregarded_entity** | **Boolean** | Indicates certification for box 16B as a QDD disregarded entity. | [optional] | +| **certify_box17_a** | **Boolean** | Indicates certification for box 17A. | [optional] | +| **certify_box17_b** | **Boolean** | Indicates certification for box 17B. | [optional] | +| **certify_box17_c** | **Boolean** | Indicates certification for box 17C. | [optional] | +| **certify_box17_d** | **Boolean** | Indicates certification for box 17D. | [optional] | +| **certify_box17_e** | **Boolean** | Indicates certification for box 17E. | [optional] | +| **certify_box18_a** | **Boolean** | Indicates certification for box 18A. | [optional] | +| **certify_box18_b** | **Boolean** | Indicates certification for box 18B. | [optional] | +| **certify_box18_c** | **Boolean** | Indicates certification for box 18C. | [optional] | +| **certify_box18_d** | **Boolean** | Indicates certification for box 18D. | [optional] | +| **certify_box18_e** | **Boolean** | Indicates certification for box 18E. | [optional] | +| **certify_box18_f** | **Boolean** | Indicates certification for box 18F. | [optional] | +| **certify_box19_a** | **Boolean** | Indicates certification for box 19A. | [optional] | +| **certify_box19_b** | **Boolean** | Indicates certification for box 19B. | [optional] | +| **certify_box19_c** | **Boolean** | Indicates certification for box 19C. | [optional] | +| **certify_box19_d** | **Boolean** | Indicates certification for box 19D. | [optional] | +| **certify_box19_e** | **Boolean** | Indicates certification for box 19E. | [optional] | +| **certify_box19_f** | **Boolean** | Indicates certification for box 19F. | [optional] | +| **certify_box20** | **Boolean** | Indicates certification for box 20. | [optional] | +| **certify_box21_a** | **Boolean** | Indicates certification for box 21A. | [optional] | +| **certify_box21_b** | **Boolean** | Indicates certification for box 21B. | [optional] | +| **certify_box21_c** | **Boolean** | Indicates certification for box 21C. | [optional] | +| **certify_box21_d** | **Boolean** | Indicates certification for box 21D. | [optional] | +| **certify_box21_e** | **Boolean** | Indicates certification for box 21E. | [optional] | +| **certify_box21_f** | **Boolean** | Indicates certification for box 21F. | [optional] | +| **box23_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 23A. | [optional] | +| **certify_box23_b** | **Boolean** | Indicates certification for box 23B. | [optional] | +| **certify_box23_c** | **Boolean** | Indicates certification for box 23C. | [optional] | +| **certify_box25** | **Boolean** | Indicates certification for box 25. | [optional] | +| **box27_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 27A. | [optional] | +| **certify_box27_b** | **Boolean** | Indicates certification for box 27B. | [optional] | +| **certify_box28** | **Boolean** | Indicates certification for box 28. | [optional] | +| **certify_box29** | **Boolean** | Indicates certification for box 29. | [optional] | +| **certify_box30_a** | **Boolean** | Indicates certification for box 30A. | [optional] | +| **certify_box30_b** | **Boolean** | Indicates certification for box 30B. | [optional] | +| **certify_box30_c** | **Boolean** | Indicates certification for box 30C. | [optional] | +| **box32_iga_country** | **String** | The IGA country information for box 32. | [optional] | +| **box32_iga_type** | **String** | The IGA type information for box 32. | [optional] | +| **box32_iga_treated_as** | **String** | The IGA treatment information for box 32. | [optional] | +| **box32_trustee_or_sponsor** | **String** | The trustee or sponsor information for box 32. | [optional] | +| **box32_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for box 32. | [optional] | +| **certify_box33_a** | **Boolean** | Indicates certification for box 33A. | [optional] | +| **certify_box33_b** | **Boolean** | Indicates certification for box 33B. | [optional] | +| **certify_box33_c** | **Boolean** | Indicates certification for box 33C. | [optional] | +| **certify_box33_d** | **Boolean** | Indicates certification for box 33D. | [optional] | +| **certify_box33_e** | **Boolean** | Indicates certification for box 33E. | [optional] | +| **certify_box33_f** | **Boolean** | Indicates certification for box 33F. | [optional] | +| **box37_a_securities_market** | **String** | The securities market information for box 37A. | [optional] | +| **box37_b_name_of_entity** | **String** | The name of the entity for box 37B. | [optional] | +| **box37_b_securities_market** | **String** | The securities market information for box 37B. | [optional] | +| **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] | +| **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] | +| **business_name** | **String** | The name of the business associated with the form. | [optional] | +| **business_other** | **String** | | [optional] | +| **exempt_payee_code** | **String** | | [optional] | +| **exempt_fatca_code** | **String** | | [optional] | +| **account_number** | **String** | The account number associated with the form. | [optional] | +| **foreign_country_indicator** | **Boolean** | Indicates whether the individual or entity is in a foreign country. | [optional] | +| **foreign_address** | **String** | The foreign address of the individual or entity. | [optional] | +| **backup_withholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | +| **is1099able** | **Boolean** | | [optional] | +| **foreign_partner_owner_or_beneficiary** | **Boolean** | Indicates whether the individual is a foreign partner, owner, or beneficiary. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BenFormDataModel.new( + type: w8ben, + signed_date: 2023-01-15T00:00Z, + birthday: null, + foreign_tin_not_required: null, + archived: false, + reference_id: REF67890, + company_id: 4004, + display_name: International Trading, + email: info@internationaltrading.com, + type_of_tin: null, + name: International Trading Co., + residence_address: 789 Global St, + residence_city: Capital City, + residence_state: DC, + residence_postal_code: 20001, + residence_country: USA, + residence_is_mailing: false, + mailing_address: P.O. Box 456, + mailing_city: Capital City, + mailing_state: DC, + mailing_postal_code: 20002, + mailing_country: USA, + tin: 34-5678901, + foreign_tin: FTIN56789, + reference_number: W8BEN45678, + citizenship_country: USA, + treaty_country: Canada, + treaty_article: Article 12, + withholding_rate: 15%, + income_type: Dividend, + treaty_reasons: Reduced withholding, + signer_name: Alice Johnson, + signer_capacity: Authorized Representative, + e_delivery_consented_at: 2023-01-15T10:00Z, + created_at: 2023-01-10T08:00Z, + updated_at: 2023-02-05T09:30Z, + employee_first_name: Jane, + employee_middle_name: A., + employee_last_name: Smith, + employee_name_suffix: Jr., + address: 123 Main St, + city: Anytown, + state: CA, + zip: 90210, + box3_marital_status: Married, + box4_last_name_differs: false, + box5_num_allowances: 3, + other_dependents: 1, + non_job_income: 5000.0, + deductions: 2000.0, + box6_additional_withheld: 150.0, + box7_exempt_from_withholding: false, + office_code: OC12345, + disregarded_entity_chapter4_fatca_status: null, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_postal_code: null, + disregarded_country: null, + ftin_not_required: null, + giin: null, + chapter3_entity_type: Partnership, + chapter4_fatca_status: Compliant, + disregarded_entity: Subsidiary Finance, + disregarded_entity_giin: GIIN78901234, + benefit_limitation: Treaty Benefit, + part4_sponsoring_entity: Parent Company, + part4_sponsoring_entity_giin: GIIN11223344, + part7_sponsoring_entity: Affiliated Organization, + part12_iga_country: USA, + part12_iga_type: Model 1, + part12_fatca_status_under_iga_annex_ii: Registered Deemed Compliant, + part12_trustee_name: Trustee Inc., + part12_trustee_is_foreign: false, + part12_model2_iga_giin: GIIN33445566, + box37_a_exchange: NYSE, + box37_b_exchange: NASDAQ, + box37_b_entity: Trading Partner, + part28_sponsoring_entity: Global Trust, + part28_sponsoring_entity_giin: GIIN99887766, + making_treaty_claim: false, + certify_box14_a: false, + certify_box14_b: false, + certify_box14_c: false, + certify_box17_1: false, + certify_box17_2: false, + certify_box18: false, + certify_box19: false, + certify_box21: false, + certify_box22: false, + certify_box23: false, + certify_box24_a: false, + certify_box24_b: false, + certify_box24_c: false, + certify_box24_d: false, + certify_box25_a: false, + certify_box25_b: false, + certify_box25_c: false, + certify_box26: false, + certify_box27: false, + certify_box28_a: false, + certify_box28_b: false, + certify_box29_a: false, + certify_box29_b: false, + certify_box29_c: false, + certify_box29_d: false, + certify_box29_e: false, + certify_box29_f: false, + certify_box30: false, + certify_box31: false, + certify_box32: false, + certify_box33: false, + certify_box34: false, + certify_box35: false, + certify_box36: false, + certify_box37_a: false, + certify_box37_b: false, + certify_box38: false, + certify_box39: false, + certify_box40_a: false, + certify_box40_b: false, + certify_box40_c: false, + certify_box41: false, + certify_box43: false, + certify_part29_signature: false, + part19_formation_or_resolution_date: null, + part20_filing_date: null, + part21_determination_date: null, + substantial_us_owners: [], + ein: null, + ein_type: null, + certify_box14: false, + certify_box15_a: false, + certify_box15_b: false, + certify_box15_c: false, + certify_box15_d: false, + certify_box15_e: false, + certify_box15_f: false, + certify_box15_g: false, + certify_box15_h: false, + certify_box15_i: false, + certify_box16_a: false, + box16_b_qdd_corporate: false, + box16_b_qdd_partnership: false, + box16_b_qdd_disregarded_entity: false, + certify_box17_a: false, + certify_box17_b: false, + certify_box17_c: false, + certify_box17_d: false, + certify_box17_e: false, + certify_box18_a: false, + certify_box18_b: false, + certify_box18_c: false, + certify_box18_d: false, + certify_box18_e: false, + certify_box18_f: false, + certify_box19_a: false, + certify_box19_b: false, + certify_box19_c: false, + certify_box19_d: false, + certify_box19_e: false, + certify_box19_f: false, + certify_box20: false, + certify_box21_a: false, + certify_box21_b: false, + certify_box21_c: false, + certify_box21_d: false, + certify_box21_e: false, + certify_box21_f: false, + box23_a_name_sponsoring_entity: null, + certify_box23_b: false, + certify_box23_c: false, + certify_box25: false, + box27_a_name_sponsoring_entity: null, + certify_box27_b: false, + certify_box28: false, + certify_box29: false, + certify_box30_a: false, + certify_box30_b: false, + certify_box30_c: false, + box32_iga_country: null, + box32_iga_type: null, + box32_iga_treated_as: null, + box32_trustee_or_sponsor: null, + box32_trustee_is_foreign: false, + certify_box33_a: false, + certify_box33_b: false, + certify_box33_c: false, + certify_box33_d: false, + certify_box33_e: false, + certify_box33_f: false, + box37_a_securities_market: null, + box37_b_name_of_entity: null, + box37_b_securities_market: null, + certify_box40: false, + box41_sponsoring_entity: null, + certify_box42: false, + box35_formed_on_date: null, + box36_filed_on_date: null, + tin_match_status: Match, + signature: null, + business_classification: LLC, + business_name: Doe Enterprises, + business_other: null, + exempt_payee_code: null, + exempt_fatca_code: null, + account_number: ACC123456, + foreign_country_indicator: false, + foreign_address: null, + backup_withholding: false, + is1099able: null, + foreign_partner_owner_or_beneficiary: false +) +``` + diff --git a/docs/A1099/V2/W8BenFormResponse.md b/docs/A1099/V2/W8BenFormResponse.md new file mode 100644 index 0000000..bbf74dc --- /dev/null +++ b/docs/A1099/V2/W8BenFormResponse.md @@ -0,0 +1,96 @@ +# AvalaraSdk::A1099::V2::W8BenFormResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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_type** | **String** | The type of TIN provided. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [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] | +| **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] | +| **signer_capacity** | **String** | The capacity in which the signer is signing the form. | [optional] | +| **id** | **String** | The unique identifier for the form. | [optional] | +| **type** | **String** | The form type. | [optional] | +| **entry_status** | **String** | The form status. | [optional] | +| **entry_status_date** | **Time** | The timestamp for the latest status update. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BenFormResponse.new( + name: International Trading Co., + citizenship_country: US, + residence_address: 789 Global St, + residence_city: Capital City, + residence_state: DC, + residence_zip: 20001, + residence_country: US, + residence_is_mailing: false, + mailing_address: P.O. Box 456, + mailing_city: Capital City, + mailing_state: DC, + mailing_zip: 20002, + mailing_country: USA, + tin_type: SSN, + tin: 123-45-6789, + foreign_tin_not_required: false, + foreign_tin: FTIN56789, + reference_number: W8BEN12345, + birthday: Mon Oct 01 17:00:00 PDT 1990, + treaty_country: CA, + treaty_article: Article 12, + treaty_reasons: Reduced withholding, + withholding_rate: 15%, + income_type: Dividend, + signer_name: Alice Johnson, + signer_capacity: Authorized Representative, + id: null, + type: null, + entry_status: null, + entry_status_date: null, + reference_id: null, + company_id: null, + display_name: null, + email: null, + archived: null, + signature: null, + signed_date: null, + e_delivery_consented_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/W8BeneFormDataModel.md b/docs/A1099/V2/W8BeneFormDataModel.md new file mode 100644 index 0000000..1183f97 --- /dev/null +++ b/docs/A1099/V2/W8BeneFormDataModel.md @@ -0,0 +1,440 @@ +# AvalaraSdk::A1099::V2::W8BeneFormDataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of the form, always W8BENE for this model. | [optional][readonly] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **disregarded_entity_chapter4_fatca_status** | **String** | The FATCA status for disregarded entities under Chapter 4. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **name** | **String** | The name of the individual or entity associated with the form. | [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_postal_code** | **String** | The postal code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [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_postal_code** | **String** | The postal code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [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_postal_code** | **String** | The postal code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **type_of_tin** | **String** | The type of TIN provided. | [optional] | +| **foreign_tin** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **ftin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **giin** | **String** | The global intermediary identification number (GIIN). | [optional] | +| **chapter3_entity_type** | **String** | The Chapter 3 entity type. | [optional] | +| **chapter4_fatca_status** | **String** | The Chapter 4 FATCA status. | [optional] | +| **disregarded_entity** | **String** | The disregarded entity information. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **benefit_limitation** | **String** | The benefit limitation for tax treaty claims. | [optional] | +| **part4_sponsoring_entity** | **String** | The sponsoring entity information for Part 4. | [optional] | +| **part4_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 4. | [optional] | +| **part7_sponsoring_entity** | **String** | The sponsoring entity information for Part 7. | [optional] | +| **part12_iga_country** | **String** | The IGA country information for Part 12. | [optional] | +| **part12_iga_type** | **String** | The IGA type information for Part 12. | [optional] | +| **part12_fatca_status_under_iga_annex_ii** | **String** | The FATCA status under IGA Annex II for Part 12. | [optional] | +| **part12_trustee_name** | **String** | The trustee name for Part 12. | [optional] | +| **part12_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for Part 12. | [optional] | +| **part12_model2_iga_giin** | **String** | The GIIN for Model 2 IGA in Part 12. | [optional] | +| **box37_a_exchange** | **String** | The exchange information for Box 37A. | [optional] | +| **box37_b_exchange** | **String** | The exchange information for Box 37B. | [optional] | +| **box37_b_entity** | **String** | The entity information for Box 37B. | [optional] | +| **part28_sponsoring_entity** | **String** | The sponsoring entity information for Part 28. | [optional] | +| **part28_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 28. | [optional] | +| **signer_name** | **String** | The name of the signer. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **residence_is_mailing** | **Boolean** | | [optional] | +| **citizenship_country** | **String** | | [optional] | +| **making_treaty_claim** | **Boolean** | | [optional] | +| **treaty_country** | **String** | | [optional] | +| **treaty_article** | **String** | | [optional] | +| **withholding_rate** | **String** | | [optional] | +| **income_type** | **String** | | [optional] | +| **treaty_reasons** | **String** | | [optional] | +| **certify_box14_a** | **Boolean** | | [optional] | +| **certify_box14_b** | **Boolean** | | [optional] | +| **certify_box14_c** | **Boolean** | | [optional] | +| **certify_box17_1** | **Boolean** | | [optional] | +| **certify_box17_2** | **Boolean** | | [optional] | +| **certify_box18** | **Boolean** | | [optional] | +| **certify_box19** | **Boolean** | | [optional] | +| **certify_box21** | **Boolean** | | [optional] | +| **certify_box22** | **Boolean** | | [optional] | +| **certify_box23** | **Boolean** | | [optional] | +| **certify_box24_a** | **Boolean** | | [optional] | +| **certify_box24_b** | **Boolean** | | [optional] | +| **certify_box24_c** | **Boolean** | | [optional] | +| **certify_box24_d** | **Boolean** | | [optional] | +| **certify_box25_a** | **Boolean** | | [optional] | +| **certify_box25_b** | **Boolean** | | [optional] | +| **certify_box25_c** | **Boolean** | | [optional] | +| **certify_box26** | **Boolean** | | [optional] | +| **certify_box27** | **Boolean** | | [optional] | +| **certify_box28_a** | **Boolean** | | [optional] | +| **certify_box28_b** | **Boolean** | | [optional] | +| **certify_box29_a** | **Boolean** | | [optional] | +| **certify_box29_b** | **Boolean** | | [optional] | +| **certify_box29_c** | **Boolean** | | [optional] | +| **certify_box29_d** | **Boolean** | | [optional] | +| **certify_box29_e** | **Boolean** | | [optional] | +| **certify_box29_f** | **Boolean** | | [optional] | +| **certify_box30** | **Boolean** | | [optional] | +| **certify_box31** | **Boolean** | | [optional] | +| **certify_box32** | **Boolean** | | [optional] | +| **certify_box33** | **Boolean** | | [optional] | +| **certify_box34** | **Boolean** | | [optional] | +| **certify_box35** | **Boolean** | | [optional] | +| **certify_box36** | **Boolean** | | [optional] | +| **certify_box37_a** | **Boolean** | | [optional] | +| **certify_box37_b** | **Boolean** | | [optional] | +| **certify_box38** | **Boolean** | | [optional] | +| **certify_box39** | **Boolean** | | [optional] | +| **certify_box40_a** | **Boolean** | | [optional] | +| **certify_box40_b** | **Boolean** | | [optional] | +| **certify_box40_c** | **Boolean** | | [optional] | +| **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] | +| **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] | +| **employee_last_name** | **String** | The last name of the employee. | [optional] | +| **employee_name_suffix** | **String** | The name suffix of the employee. | [optional] | +| **address** | **String** | The 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] | +| **box3_marital_status** | **String** | The marital status of the employee. | [optional] | +| **box4_last_name_differs** | **Boolean** | Indicates whether the last name differs from prior records. | [optional] | +| **box5_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] | +| **box6_additional_withheld** | **Float** | The additional amount withheld. | [optional] | +| **box7_exempt_from_withholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | +| **office_code** | **String** | The office code associated with the form. | [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] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **Integer** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **signer_capacity** | **String** | The capacity in which the signer is signing the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | +| **ein** | **String** | The employer identification number (EIN). | [optional] | +| **ein_type** | **String** | The type of employer identification number (EIN). | [optional] | +| **certify_box14** | **Boolean** | Indicates certification for box 14. | [optional] | +| **certify_box15_a** | **Boolean** | Indicates certification for box 15A. | [optional] | +| **certify_box15_b** | **Boolean** | Indicates certification for box 15B. | [optional] | +| **certify_box15_c** | **Boolean** | Indicates certification for box 15C. | [optional] | +| **certify_box15_d** | **Boolean** | Indicates certification for box 15D. | [optional] | +| **certify_box15_e** | **Boolean** | Indicates certification for box 15E. | [optional] | +| **certify_box15_f** | **Boolean** | Indicates certification for box 15F. | [optional] | +| **certify_box15_g** | **Boolean** | Indicates certification for box 15G. | [optional] | +| **certify_box15_h** | **Boolean** | Indicates certification for box 15H. | [optional] | +| **certify_box15_i** | **Boolean** | Indicates certification for box 15I. | [optional] | +| **certify_box16_a** | **Boolean** | Indicates certification for box 16A. | [optional] | +| **box16_b_qdd_corporate** | **Boolean** | Indicates certification for box 16B as a QDD corporate entity. | [optional] | +| **box16_b_qdd_partnership** | **Boolean** | Indicates certification for box 16B as a QDD partnership. | [optional] | +| **box16_b_qdd_disregarded_entity** | **Boolean** | Indicates certification for box 16B as a QDD disregarded entity. | [optional] | +| **certify_box17_a** | **Boolean** | Indicates certification for box 17A. | [optional] | +| **certify_box17_b** | **Boolean** | Indicates certification for box 17B. | [optional] | +| **certify_box17_c** | **Boolean** | Indicates certification for box 17C. | [optional] | +| **certify_box17_d** | **Boolean** | Indicates certification for box 17D. | [optional] | +| **certify_box17_e** | **Boolean** | Indicates certification for box 17E. | [optional] | +| **certify_box18_a** | **Boolean** | Indicates certification for box 18A. | [optional] | +| **certify_box18_b** | **Boolean** | Indicates certification for box 18B. | [optional] | +| **certify_box18_c** | **Boolean** | Indicates certification for box 18C. | [optional] | +| **certify_box18_d** | **Boolean** | Indicates certification for box 18D. | [optional] | +| **certify_box18_e** | **Boolean** | Indicates certification for box 18E. | [optional] | +| **certify_box18_f** | **Boolean** | Indicates certification for box 18F. | [optional] | +| **certify_box19_a** | **Boolean** | Indicates certification for box 19A. | [optional] | +| **certify_box19_b** | **Boolean** | Indicates certification for box 19B. | [optional] | +| **certify_box19_c** | **Boolean** | Indicates certification for box 19C. | [optional] | +| **certify_box19_d** | **Boolean** | Indicates certification for box 19D. | [optional] | +| **certify_box19_e** | **Boolean** | Indicates certification for box 19E. | [optional] | +| **certify_box19_f** | **Boolean** | Indicates certification for box 19F. | [optional] | +| **certify_box20** | **Boolean** | Indicates certification for box 20. | [optional] | +| **certify_box21_a** | **Boolean** | Indicates certification for box 21A. | [optional] | +| **certify_box21_b** | **Boolean** | Indicates certification for box 21B. | [optional] | +| **certify_box21_c** | **Boolean** | Indicates certification for box 21C. | [optional] | +| **certify_box21_d** | **Boolean** | Indicates certification for box 21D. | [optional] | +| **certify_box21_e** | **Boolean** | Indicates certification for box 21E. | [optional] | +| **certify_box21_f** | **Boolean** | Indicates certification for box 21F. | [optional] | +| **box23_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 23A. | [optional] | +| **certify_box23_b** | **Boolean** | Indicates certification for box 23B. | [optional] | +| **certify_box23_c** | **Boolean** | Indicates certification for box 23C. | [optional] | +| **certify_box25** | **Boolean** | Indicates certification for box 25. | [optional] | +| **box27_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 27A. | [optional] | +| **certify_box27_b** | **Boolean** | Indicates certification for box 27B. | [optional] | +| **certify_box28** | **Boolean** | Indicates certification for box 28. | [optional] | +| **certify_box29** | **Boolean** | Indicates certification for box 29. | [optional] | +| **certify_box30_a** | **Boolean** | Indicates certification for box 30A. | [optional] | +| **certify_box30_b** | **Boolean** | Indicates certification for box 30B. | [optional] | +| **certify_box30_c** | **Boolean** | Indicates certification for box 30C. | [optional] | +| **box32_iga_country** | **String** | The IGA country information for box 32. | [optional] | +| **box32_iga_type** | **String** | The IGA type information for box 32. | [optional] | +| **box32_iga_treated_as** | **String** | The IGA treatment information for box 32. | [optional] | +| **box32_trustee_or_sponsor** | **String** | The trustee or sponsor information for box 32. | [optional] | +| **box32_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for box 32. | [optional] | +| **certify_box33_a** | **Boolean** | Indicates certification for box 33A. | [optional] | +| **certify_box33_b** | **Boolean** | Indicates certification for box 33B. | [optional] | +| **certify_box33_c** | **Boolean** | Indicates certification for box 33C. | [optional] | +| **certify_box33_d** | **Boolean** | Indicates certification for box 33D. | [optional] | +| **certify_box33_e** | **Boolean** | Indicates certification for box 33E. | [optional] | +| **certify_box33_f** | **Boolean** | Indicates certification for box 33F. | [optional] | +| **box37_a_securities_market** | **String** | The securities market information for box 37A. | [optional] | +| **box37_b_name_of_entity** | **String** | The name of the entity for box 37B. | [optional] | +| **box37_b_securities_market** | **String** | The securities market information for box 37B. | [optional] | +| **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] | +| **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] | +| **business_name** | **String** | The name of the business associated with the form. | [optional] | +| **business_other** | **String** | | [optional] | +| **exempt_payee_code** | **String** | | [optional] | +| **exempt_fatca_code** | **String** | | [optional] | +| **account_number** | **String** | The account number associated with the form. | [optional] | +| **foreign_country_indicator** | **Boolean** | Indicates whether the individual or entity is in a foreign country. | [optional] | +| **foreign_address** | **String** | The foreign address of the individual or entity. | [optional] | +| **backup_withholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | +| **is1099able** | **Boolean** | | [optional] | +| **foreign_partner_owner_or_beneficiary** | **Boolean** | Indicates whether the individual is a foreign partner, owner, or beneficiary. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BeneFormDataModel.new( + type: w8bene, + signed_date: 2022-04-29T00:00Z, + disregarded_entity_chapter4_fatca_status: null, + created_at: 2022-04-29T10:00Z, + name: Global Enterprises LLC, + residence_address: 123 International Blvd, + residence_city: Metropolis, + residence_state: NY, + residence_postal_code: 10118, + residence_country: USA, + mailing_address: P.O. Box 123, + mailing_city: Metropolis, + mailing_state: NY, + mailing_postal_code: 10119, + mailing_country: USA, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_postal_code: null, + disregarded_country: null, + tin: 12-3456789, + type_of_tin: null, + foreign_tin: null, + ftin_not_required: null, + reference_number: W8BENE12345, + giin: GIIN12345678, + chapter3_entity_type: Corporation, + chapter4_fatca_status: Active, + disregarded_entity: Subsidiary LLC, + disregarded_entity_giin: GIIN87654321, + benefit_limitation: Treaty Benefit, + part4_sponsoring_entity: Parent Company, + part4_sponsoring_entity_giin: GIIN11223344, + part7_sponsoring_entity: Affiliated Organization, + part12_iga_country: USA, + part12_iga_type: Model 1, + part12_fatca_status_under_iga_annex_ii: Registered Deemed Compliant, + part12_trustee_name: Trustee Inc., + part12_trustee_is_foreign: false, + part12_model2_iga_giin: GIIN33445566, + box37_a_exchange: NYSE, + box37_b_exchange: NASDAQ, + box37_b_entity: Trading Partner, + part28_sponsoring_entity: Global Trust, + part28_sponsoring_entity_giin: GIIN99887766, + signer_name: John Doe, + e_delivery_consented_at: 2022-04-29T15:30Z, + residence_is_mailing: false, + citizenship_country: null, + making_treaty_claim: false, + treaty_country: null, + treaty_article: null, + withholding_rate: null, + income_type: null, + treaty_reasons: null, + certify_box14_a: false, + certify_box14_b: false, + certify_box14_c: false, + certify_box17_1: false, + certify_box17_2: false, + certify_box18: false, + certify_box19: false, + certify_box21: false, + certify_box22: false, + certify_box23: false, + certify_box24_a: false, + certify_box24_b: false, + certify_box24_c: false, + certify_box24_d: false, + certify_box25_a: false, + certify_box25_b: false, + certify_box25_c: false, + certify_box26: false, + certify_box27: false, + certify_box28_a: false, + certify_box28_b: false, + certify_box29_a: false, + certify_box29_b: false, + certify_box29_c: false, + certify_box29_d: false, + certify_box29_e: false, + certify_box29_f: false, + certify_box30: false, + certify_box31: false, + certify_box32: false, + certify_box33: false, + certify_box34: false, + certify_box35: false, + certify_box36: false, + certify_box37_a: false, + certify_box37_b: false, + certify_box38: false, + certify_box39: false, + certify_box40_a: false, + certify_box40_b: false, + certify_box40_c: false, + certify_box41: false, + certify_box43: false, + certify_part29_signature: false, + part19_formation_or_resolution_date: null, + part20_filing_date: null, + part21_determination_date: null, + substantial_us_owners: [], + employee_first_name: Jane, + employee_middle_name: A., + employee_last_name: Smith, + employee_name_suffix: Jr., + address: 123 Main St, + city: Anytown, + state: CA, + zip: 90210, + box3_marital_status: Married, + box4_last_name_differs: false, + box5_num_allowances: 3, + other_dependents: 1, + non_job_income: 5000.0, + deductions: 2000.0, + box6_additional_withheld: 150.0, + box7_exempt_from_withholding: false, + office_code: OC12345, + birthday: null, + foreign_tin_not_required: null, + archived: false, + reference_id: REF67890, + company_id: 4004, + display_name: Global Financials, + email: contact@globalfinancials.com, + signer_capacity: Authorized Representative, + updated_at: 2023-06-20T14:30Z, + ein: null, + ein_type: null, + certify_box14: false, + certify_box15_a: false, + certify_box15_b: false, + certify_box15_c: false, + certify_box15_d: false, + certify_box15_e: false, + certify_box15_f: false, + certify_box15_g: false, + certify_box15_h: false, + certify_box15_i: false, + certify_box16_a: false, + box16_b_qdd_corporate: false, + box16_b_qdd_partnership: false, + box16_b_qdd_disregarded_entity: false, + certify_box17_a: false, + certify_box17_b: false, + certify_box17_c: false, + certify_box17_d: false, + certify_box17_e: false, + certify_box18_a: false, + certify_box18_b: false, + certify_box18_c: false, + certify_box18_d: false, + certify_box18_e: false, + certify_box18_f: false, + certify_box19_a: false, + certify_box19_b: false, + certify_box19_c: false, + certify_box19_d: false, + certify_box19_e: false, + certify_box19_f: false, + certify_box20: false, + certify_box21_a: false, + certify_box21_b: false, + certify_box21_c: false, + certify_box21_d: false, + certify_box21_e: false, + certify_box21_f: false, + box23_a_name_sponsoring_entity: null, + certify_box23_b: false, + certify_box23_c: false, + certify_box25: false, + box27_a_name_sponsoring_entity: null, + certify_box27_b: false, + certify_box28: false, + certify_box29: false, + certify_box30_a: false, + certify_box30_b: false, + certify_box30_c: false, + box32_iga_country: null, + box32_iga_type: null, + box32_iga_treated_as: null, + box32_trustee_or_sponsor: null, + box32_trustee_is_foreign: false, + certify_box33_a: false, + certify_box33_b: false, + certify_box33_c: false, + certify_box33_d: false, + certify_box33_e: false, + certify_box33_f: false, + box37_a_securities_market: null, + box37_b_name_of_entity: null, + box37_b_securities_market: null, + certify_box40: false, + box41_sponsoring_entity: null, + certify_box42: false, + box35_formed_on_date: null, + box36_filed_on_date: null, + tin_match_status: Match, + signature: null, + business_classification: LLC, + business_name: Doe Enterprises, + business_other: null, + exempt_payee_code: null, + exempt_fatca_code: null, + account_number: ACC123456, + foreign_country_indicator: false, + foreign_address: null, + backup_withholding: false, + is1099able: null, + foreign_partner_owner_or_beneficiary: false +) +``` + diff --git a/docs/A1099/V2/W8ImyFormDataModel.md b/docs/A1099/V2/W8ImyFormDataModel.md new file mode 100644 index 0000000..3ab0af3 --- /dev/null +++ b/docs/A1099/V2/W8ImyFormDataModel.md @@ -0,0 +1,440 @@ +# AvalaraSdk::A1099::V2::W8ImyFormDataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of the form, always W8IMY for this model. | [optional][readonly] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **disregarded_entity_chapter4_fatca_status** | **String** | The FATCA status for disregarded entities under Chapter 4. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN) of the employee. | [optional] | +| **type_of_tin** | **String** | The type of TIN provided. | [optional] | +| **name** | **String** | The name of the individual or entity associated with the form. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **chapter3_entity_type** | **String** | The Chapter 3 entity type. | [optional] | +| **chapter4_fatca_status** | **String** | The Chapter 4 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_postal_code** | **String** | The postal 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_postal_code** | **String** | The postal code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [optional] | +| **disregarded_entity** | **String** | The disregarded entity information. | [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_postal_code** | **String** | The postal code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **ein** | **String** | The employer identification number (EIN). | [optional] | +| **ein_type** | **String** | The type of employer identification number (EIN). | [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] | +| **certify_box14** | **Boolean** | Indicates certification for box 14. | [optional] | +| **certify_box15_a** | **Boolean** | Indicates certification for box 15A. | [optional] | +| **certify_box15_b** | **Boolean** | Indicates certification for box 15B. | [optional] | +| **certify_box15_c** | **Boolean** | Indicates certification for box 15C. | [optional] | +| **certify_box15_d** | **Boolean** | Indicates certification for box 15D. | [optional] | +| **certify_box15_e** | **Boolean** | Indicates certification for box 15E. | [optional] | +| **certify_box15_f** | **Boolean** | Indicates certification for box 15F. | [optional] | +| **certify_box15_g** | **Boolean** | Indicates certification for box 15G. | [optional] | +| **certify_box15_h** | **Boolean** | Indicates certification for box 15H. | [optional] | +| **certify_box15_i** | **Boolean** | Indicates certification for box 15I. | [optional] | +| **certify_box16_a** | **Boolean** | Indicates certification for box 16A. | [optional] | +| **box16_b_qdd_corporate** | **Boolean** | Indicates certification for box 16B as a QDD corporate entity. | [optional] | +| **box16_b_qdd_partnership** | **Boolean** | Indicates certification for box 16B as a QDD partnership. | [optional] | +| **box16_b_qdd_disregarded_entity** | **Boolean** | Indicates certification for box 16B as a QDD disregarded entity. | [optional] | +| **certify_box17_a** | **Boolean** | Indicates certification for box 17A. | [optional] | +| **certify_box17_b** | **Boolean** | Indicates certification for box 17B. | [optional] | +| **certify_box17_c** | **Boolean** | Indicates certification for box 17C. | [optional] | +| **certify_box17_d** | **Boolean** | Indicates certification for box 17D. | [optional] | +| **certify_box17_e** | **Boolean** | Indicates certification for box 17E. | [optional] | +| **certify_box18_a** | **Boolean** | Indicates certification for box 18A. | [optional] | +| **certify_box18_b** | **Boolean** | Indicates certification for box 18B. | [optional] | +| **certify_box18_c** | **Boolean** | Indicates certification for box 18C. | [optional] | +| **certify_box18_d** | **Boolean** | Indicates certification for box 18D. | [optional] | +| **certify_box18_e** | **Boolean** | Indicates certification for box 18E. | [optional] | +| **certify_box18_f** | **Boolean** | Indicates certification for box 18F. | [optional] | +| **certify_box19_a** | **Boolean** | Indicates certification for box 19A. | [optional] | +| **certify_box19_b** | **Boolean** | Indicates certification for box 19B. | [optional] | +| **certify_box19_c** | **Boolean** | Indicates certification for box 19C. | [optional] | +| **certify_box19_d** | **Boolean** | Indicates certification for box 19D. | [optional] | +| **certify_box19_e** | **Boolean** | Indicates certification for box 19E. | [optional] | +| **certify_box19_f** | **Boolean** | Indicates certification for box 19F. | [optional] | +| **certify_box20** | **Boolean** | Indicates certification for box 20. | [optional] | +| **certify_box21_a** | **Boolean** | Indicates certification for box 21A. | [optional] | +| **certify_box21_b** | **Boolean** | Indicates certification for box 21B. | [optional] | +| **certify_box21_c** | **Boolean** | Indicates certification for box 21C. | [optional] | +| **certify_box21_d** | **Boolean** | Indicates certification for box 21D. | [optional] | +| **certify_box21_e** | **Boolean** | Indicates certification for box 21E. | [optional] | +| **certify_box21_f** | **Boolean** | Indicates certification for box 21F. | [optional] | +| **certify_box22** | **Boolean** | Indicates certification for box 22. | [optional] | +| **box23_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 23A. | [optional] | +| **certify_box23_b** | **Boolean** | Indicates certification for box 23B. | [optional] | +| **certify_box23_c** | **Boolean** | Indicates certification for box 23C. | [optional] | +| **certify_box24_a** | **Boolean** | Indicates certification for box 24A. | [optional] | +| **certify_box24_b** | **Boolean** | Indicates certification for box 24B. | [optional] | +| **certify_box24_c** | **Boolean** | Indicates certification for box 24C. | [optional] | +| **certify_box25** | **Boolean** | Indicates certification for box 25. | [optional] | +| **certify_box26** | **Boolean** | Indicates certification for box 26. | [optional] | +| **box27_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 27A. | [optional] | +| **certify_box27_b** | **Boolean** | Indicates certification for box 27B. | [optional] | +| **certify_box28** | **Boolean** | Indicates certification for box 28. | [optional] | +| **certify_box29** | **Boolean** | Indicates certification for box 29. | [optional] | +| **certify_box30_a** | **Boolean** | Indicates certification for box 30A. | [optional] | +| **certify_box30_b** | **Boolean** | Indicates certification for box 30B. | [optional] | +| **certify_box30_c** | **Boolean** | Indicates certification for box 30C. | [optional] | +| **certify_box31** | **Boolean** | Indicates certification for box 31. | [optional] | +| **certify_box32** | **Boolean** | Indicates certification for box 32. | [optional] | +| **box32_iga_country** | **String** | The IGA country information for box 32. | [optional] | +| **box32_iga_type** | **String** | The IGA type information for box 32. | [optional] | +| **box32_iga_treated_as** | **String** | The IGA treatment information for box 32. | [optional] | +| **box32_trustee_or_sponsor** | **String** | The trustee or sponsor information for box 32. | [optional] | +| **box32_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for box 32. | [optional] | +| **certify_box33_a** | **Boolean** | Indicates certification for box 33A. | [optional] | +| **certify_box33_b** | **Boolean** | Indicates certification for box 33B. | [optional] | +| **certify_box33_c** | **Boolean** | Indicates certification for box 33C. | [optional] | +| **certify_box33_d** | **Boolean** | Indicates certification for box 33D. | [optional] | +| **certify_box33_e** | **Boolean** | Indicates certification for box 33E. | [optional] | +| **certify_box33_f** | **Boolean** | Indicates certification for box 33F. | [optional] | +| **certify_box34** | **Boolean** | Indicates certification for box 34. | [optional] | +| **certify_box35** | **Boolean** | Indicates certification for box 35. | [optional] | +| **certify_box36** | **Boolean** | Indicates certification for box 36. | [optional] | +| **certify_box37_a** | **Boolean** | Indicates certification for box 37A. | [optional] | +| **box37_a_securities_market** | **String** | The securities market information for box 37A. | [optional] | +| **certify_box37_b** | **Boolean** | Indicates certification for box 37B. | [optional] | +| **box37_b_name_of_entity** | **String** | The name of the entity for box 37B. | [optional] | +| **box37_b_securities_market** | **String** | The securities market information for box 37B. | [optional] | +| **certify_box38** | **Boolean** | Indicates certification for box 38. | [optional] | +| **certify_box39** | **Boolean** | Indicates certification for box 39. | [optional] | +| **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] | +| **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] | +| **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] | +| **address** | **String** | The 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] | +| **box3_marital_status** | **String** | The marital status of the employee. | [optional] | +| **box4_last_name_differs** | **Boolean** | Indicates whether the last name differs from prior records. | [optional] | +| **box5_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] | +| **box6_additional_withheld** | **Float** | The additional amount withheld. | [optional] | +| **box7_exempt_from_withholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | +| **office_code** | **String** | The office code associated with the form. | [optional] | +| **ftin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | +| **benefit_limitation** | **String** | The benefit limitation for tax treaty claims. | [optional] | +| **part4_sponsoring_entity** | **String** | The sponsoring entity information for Part 4. | [optional] | +| **part4_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 4. | [optional] | +| **part7_sponsoring_entity** | **String** | The sponsoring entity information for Part 7. | [optional] | +| **part12_iga_country** | **String** | The IGA country information for Part 12. | [optional] | +| **part12_iga_type** | **String** | The IGA type information for Part 12. | [optional] | +| **part12_fatca_status_under_iga_annex_ii** | **String** | The FATCA status under IGA Annex II for Part 12. | [optional] | +| **part12_trustee_name** | **String** | The trustee name for Part 12. | [optional] | +| **part12_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for Part 12. | [optional] | +| **part12_model2_iga_giin** | **String** | The GIIN for Model 2 IGA in Part 12. | [optional] | +| **box37_a_exchange** | **String** | The exchange information for Box 37A. | [optional] | +| **box37_b_exchange** | **String** | The exchange information for Box 37B. | [optional] | +| **box37_b_entity** | **String** | The entity information for Box 37B. | [optional] | +| **part28_sponsoring_entity** | **String** | The sponsoring entity information for Part 28. | [optional] | +| **part28_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 28. | [optional] | +| **making_treaty_claim** | **Boolean** | | [optional] | +| **treaty_country** | **String** | The country for which the treaty applies. | [optional] | +| **treaty_article** | **String** | The specific article of the treaty being claimed. | [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] | +| **treaty_reasons** | **String** | The reasons for claiming treaty benefits. | [optional] | +| **certify_box14_a** | **Boolean** | | [optional] | +| **certify_box14_b** | **Boolean** | | [optional] | +| **certify_box14_c** | **Boolean** | | [optional] | +| **certify_box17_1** | **Boolean** | | [optional] | +| **certify_box17_2** | **Boolean** | | [optional] | +| **certify_box18** | **Boolean** | | [optional] | +| **certify_box19** | **Boolean** | | [optional] | +| **certify_box21** | **Boolean** | | [optional] | +| **certify_box23** | **Boolean** | | [optional] | +| **certify_box24_d** | **Boolean** | | [optional] | +| **certify_box25_a** | **Boolean** | | [optional] | +| **certify_box25_b** | **Boolean** | | [optional] | +| **certify_box25_c** | **Boolean** | | [optional] | +| **certify_box27** | **Boolean** | | [optional] | +| **certify_box28_a** | **Boolean** | | [optional] | +| **certify_box28_b** | **Boolean** | | [optional] | +| **certify_box29_a** | **Boolean** | | [optional] | +| **certify_box29_b** | **Boolean** | | [optional] | +| **certify_box29_c** | **Boolean** | | [optional] | +| **certify_box29_d** | **Boolean** | | [optional] | +| **certify_box29_e** | **Boolean** | | [optional] | +| **certify_box29_f** | **Boolean** | | [optional] | +| **certify_box30** | **Boolean** | | [optional] | +| **certify_box33** | **Boolean** | | [optional] | +| **certify_box40_a** | **Boolean** | | [optional] | +| **certify_box40_b** | **Boolean** | | [optional] | +| **certify_box40_c** | **Boolean** | | [optional] | +| **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] | +| **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] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **Integer** | The ID of the associated company. | [optional] | +| **signer_capacity** | **String** | The capacity in which the signer is signing the form. | [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] | +| **business_name** | **String** | The name of the business associated with the form. | [optional] | +| **business_other** | **String** | | [optional] | +| **exempt_payee_code** | **String** | | [optional] | +| **exempt_fatca_code** | **String** | | [optional] | +| **account_number** | **String** | The account number associated with the form. | [optional] | +| **foreign_country_indicator** | **Boolean** | Indicates whether the individual or entity is in a foreign country. | [optional] | +| **foreign_address** | **String** | The foreign address of the individual or entity. | [optional] | +| **backup_withholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | +| **is1099able** | **Boolean** | | [optional] | +| **foreign_partner_owner_or_beneficiary** | **Boolean** | Indicates whether the individual is a foreign partner, owner, or beneficiary. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8ImyFormDataModel.new( + type: w8imy, + signed_date: 2023-06-10T00:00Z, + disregarded_entity_chapter4_fatca_status: null, + created_at: 2023-06-05T09:00Z, + updated_at: 2023-06-20T14:30Z, + display_name: Global Financials, + email: contact@globalfinancials.com, + tin: null, + type_of_tin: null, + name: Global Financials LLC, + citizenship_country: USA, + chapter3_entity_type: Partnership, + chapter4_fatca_status: Compliant, + residence_address: 321 Wealth Ave, + residence_city: Finance City, + residence_state: TX, + residence_postal_code: 75001, + residence_country: USA, + residence_is_mailing: false, + mailing_address: P.O. Box 789, + mailing_city: Finance City, + mailing_state: TX, + mailing_postal_code: 75002, + mailing_country: USA, + disregarded_entity: Subsidiary Finance, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_postal_code: null, + disregarded_country: null, + disregarded_entity_giin: GIIN78901234, + ein: null, + ein_type: null, + giin: null, + foreign_tin: null, + reference_number: W8IMY56789, + certify_box14: false, + certify_box15_a: false, + certify_box15_b: false, + certify_box15_c: false, + certify_box15_d: false, + certify_box15_e: false, + certify_box15_f: false, + certify_box15_g: false, + certify_box15_h: false, + certify_box15_i: false, + certify_box16_a: false, + box16_b_qdd_corporate: false, + box16_b_qdd_partnership: false, + box16_b_qdd_disregarded_entity: false, + certify_box17_a: false, + certify_box17_b: false, + certify_box17_c: false, + certify_box17_d: false, + certify_box17_e: false, + certify_box18_a: false, + certify_box18_b: false, + certify_box18_c: false, + certify_box18_d: false, + certify_box18_e: false, + certify_box18_f: false, + certify_box19_a: false, + certify_box19_b: false, + certify_box19_c: false, + certify_box19_d: false, + certify_box19_e: false, + certify_box19_f: false, + certify_box20: false, + certify_box21_a: false, + certify_box21_b: false, + certify_box21_c: false, + certify_box21_d: false, + certify_box21_e: false, + certify_box21_f: false, + certify_box22: false, + box23_a_name_sponsoring_entity: null, + certify_box23_b: false, + certify_box23_c: false, + certify_box24_a: false, + certify_box24_b: false, + certify_box24_c: false, + certify_box25: false, + certify_box26: false, + box27_a_name_sponsoring_entity: null, + certify_box27_b: false, + certify_box28: false, + certify_box29: false, + certify_box30_a: false, + certify_box30_b: false, + certify_box30_c: false, + certify_box31: false, + certify_box32: false, + box32_iga_country: null, + box32_iga_type: null, + box32_iga_treated_as: null, + box32_trustee_or_sponsor: null, + box32_trustee_is_foreign: false, + certify_box33_a: false, + certify_box33_b: false, + certify_box33_c: false, + certify_box33_d: false, + certify_box33_e: false, + certify_box33_f: false, + certify_box34: false, + certify_box35: false, + certify_box36: false, + certify_box37_a: false, + box37_a_securities_market: null, + certify_box37_b: false, + box37_b_name_of_entity: null, + box37_b_securities_market: null, + certify_box38: false, + certify_box39: false, + certify_box40: false, + box41_sponsoring_entity: null, + certify_box42: false, + signer_name: Richard Roe, + e_delivery_consented_at: 2023-06-10T11:00Z, + box35_formed_on_date: null, + box36_filed_on_date: null, + employee_first_name: Jane, + employee_middle_name: A., + employee_last_name: Smith, + employee_name_suffix: Jr., + address: 123 Main St, + city: Anytown, + state: CA, + zip: 90210, + box3_marital_status: Married, + box4_last_name_differs: false, + box5_num_allowances: 3, + other_dependents: 1, + non_job_income: 5000.0, + deductions: 2000.0, + box6_additional_withheld: 150.0, + box7_exempt_from_withholding: false, + office_code: OC12345, + ftin_not_required: null, + benefit_limitation: Treaty Benefit, + part4_sponsoring_entity: Parent Company, + part4_sponsoring_entity_giin: GIIN11223344, + part7_sponsoring_entity: Affiliated Organization, + part12_iga_country: USA, + part12_iga_type: Model 1, + part12_fatca_status_under_iga_annex_ii: Registered Deemed Compliant, + part12_trustee_name: Trustee Inc., + part12_trustee_is_foreign: false, + part12_model2_iga_giin: GIIN33445566, + box37_a_exchange: NYSE, + box37_b_exchange: NASDAQ, + box37_b_entity: Trading Partner, + part28_sponsoring_entity: Global Trust, + part28_sponsoring_entity_giin: GIIN99887766, + making_treaty_claim: false, + treaty_country: Canada, + treaty_article: Article 12, + withholding_rate: 15%, + income_type: Dividend, + treaty_reasons: Reduced withholding, + certify_box14_a: false, + certify_box14_b: false, + certify_box14_c: false, + certify_box17_1: false, + certify_box17_2: false, + certify_box18: false, + certify_box19: false, + certify_box21: false, + certify_box23: false, + certify_box24_d: false, + certify_box25_a: false, + certify_box25_b: false, + certify_box25_c: false, + certify_box27: false, + certify_box28_a: false, + certify_box28_b: false, + certify_box29_a: false, + certify_box29_b: false, + certify_box29_c: false, + certify_box29_d: false, + certify_box29_e: false, + certify_box29_f: false, + certify_box30: false, + certify_box33: false, + certify_box40_a: false, + certify_box40_b: false, + certify_box40_c: false, + certify_box41: false, + certify_box43: false, + certify_part29_signature: false, + part19_formation_or_resolution_date: null, + part20_filing_date: null, + part21_determination_date: null, + substantial_us_owners: [], + birthday: null, + foreign_tin_not_required: null, + archived: false, + reference_id: REF67890, + company_id: 4004, + signer_capacity: Authorized Representative, + tin_match_status: Match, + signature: null, + business_classification: LLC, + business_name: Doe Enterprises, + business_other: null, + exempt_payee_code: null, + exempt_fatca_code: null, + account_number: ACC123456, + foreign_country_indicator: false, + foreign_address: null, + backup_withholding: false, + is1099able: null, + foreign_partner_owner_or_beneficiary: false +) +``` + diff --git a/docs/A1099/V2/W8ImyFormResponse.md b/docs/A1099/V2/W8ImyFormResponse.md new file mode 100644 index 0000000..81cbb51 --- /dev/null +++ b/docs/A1099/V2/W8ImyFormResponse.md @@ -0,0 +1,266 @@ +# AvalaraSdk::A1099::V2::W8ImyFormResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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** | **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] | +| **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] | +| **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] | +| **id** | **String** | The unique identifier for the form. | [optional] | +| **type** | **String** | The form type. | [optional] | +| **entry_status** | **String** | The form status. | [optional] | +| **entry_status_date** | **Time** | The timestamp for the latest status update. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8ImyFormResponse.new( + name: Global Financials LLC, + citizenship_country: USA, + disregarded_entity: null, + entity_type: Partnership, + fatca_status: Compliant, + residence_address: 321 Wealth Ave, + residence_city: Finance City, + residence_state: TX, + residence_zip: 75001, + residence_country: USA, + residence_is_mailing: false, + mailing_address: P.O. Box 789, + mailing_city: Finance City, + mailing_state: TX, + mailing_zip: 75002, + mailing_country: USA, + tin_type: EIN, + tin: 123-45-6789, + giin: GIIN12345678, + foreign_tin: null, + reference_number: W8IMY56789, + 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: false, + qi_primary_withholding_responsibility_certification: false, + qi_withholding_responsibility_for_ptp_sales_certification: false, + qi_nominee_withholding_responsibility_for_ptp_distributions_certification: false, + qi_securities_lender_substitute_dividend_withholding_certification: false, + qi_withholding_and1099_reporting_responsibility_certification: false, + qi_form1099_or_fatca_reporting_responsibility_certification: false, + qi_opt_out_of_form1099_reporting_certification: false, + qi_withholding_rate_pool_certification: false, + qi_intermediary_or_flow_through_entity_documentation_certification: false, + qualified_derivatives_dealer_certification: false, + qdd_corporation: false, + qdd_partnership: false, + qdd_disregarded_entity: false, + nonqualified_intermediary_certification: false, + nqi_withholding_statement_transmission_certification: false, + nqi_withholding_rate_pool_compliance_certification: false, + nqi_qualified_securities_lender_certification: false, + nqi_alternative_withholding_statement_verification_certification: false, + territory_financial_institution_certification: false, + tfi_treated_as_us_person_certification: false, + tfi_withholding_statement_transmission_certification: false, + tfi_treated_as_us_person_for_ptp_sales_certification: false, + tfi_nominee_us_person_for_ptp_distributions_certification: false, + tfi_not_nominee_for_ptp_distributions_certification: false, + us_branch_non_effectively_connected_income_certification: false, + us_branch_agreement_to_be_treated_as_us_person_certification: false, + us_branch_withholding_statement_and_compliance_certification: false, + us_branch_acting_as_us_person_for_ptp_sales_certification: false, + us_branch_nominee_for_ptp_distributions_certification: false, + us_branch_not_nominee_for_ptp_distributions_certification: false, + withholding_foreign_partnership_or_trust_certification: false, + nonwithholding_foreign_entity_withholding_statement_certification: false, + foreign_entity_partner_in_lower_tier_partnership_certification: false, + foreign_partnership_amount_realized_section1446_f_certification: false, + foreign_partnership_modified_amount_realized_certification: false, + foreign_grantor_trust_amount_realized_allocation_certification: false, + alternative_withholding_statement_reliance_certification: false, + np_ffi_with_exempt_beneficial_owners_certification: false, + ffi_sponsoring_entity: null, + investment_entity_certification: false, + controlled_foreign_corporation_certification: false, + owner_documented_ffi_certification: false, + owner_documented_ffi_reporting_statement_certification: false, + owner_documented_ffi_auditor_letter_certification: false, + compliant_nonregistering_local_bank_certification: false, + compliant_ffi_low_value_accounts_certification: false, + sponsored_closely_held_entity_sponsoring_entity: null, + sponsored_closely_held_investment_vehicle_certification: false, + compliant_limited_life_debt_entity_certification: false, + investment_entity_no_financial_accounts_certification: false, + restricted_distributor_certification: false, + restricted_distributor_agreement_certification: false, + restricted_distributor_preexisting_sales_compliance_certification: false, + foreign_central_bank_of_issue_certification: false, + nonreporting_iga_ffi_certification: false, + 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: false, + qualified_retirement_fund_certification: false, + narrow_participation_retirement_fund_certification: false, + section401_a_equivalent_pension_plan_certification: false, + investment_entity_for_retirement_funds_certification: false, + exempt_beneficial_owner_sponsored_retirement_fund_certification: false, + excepted_nonfinancial_group_entity_certification: false, + excepted_nonfinancial_start_up_certification: false, + startup_formation_or_resolution_date: null, + excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification: false, + nonfinancial_entity_filing_date: null, + publicly_traded_nffe_certification: false, + publicly_traded_nffe_securities_market: null, + nffe_affiliate_of_publicly_traded_entity_certification: false, + publicly_traded_entity: null, + nffe_affiliate_of_publicly_traded_entity_securities_market: null, + excepted_territory_nffe_certification: false, + active_nffe_certification: false, + passive_nffe_certification: false, + sponsored_direct_reporting_nffe_certification: false, + direct_reporting_nffe_sponsoring_entity: null, + signer_name: null, + id: null, + type: null, + entry_status: null, + entry_status_date: null, + reference_id: null, + company_id: null, + display_name: null, + email: null, + archived: null, + signature: null, + signed_date: null, + e_delivery_consented_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/W9FormBaseResponse.md b/docs/A1099/V2/W9FormBaseResponse.md new file mode 100644 index 0000000..b89b51c --- /dev/null +++ b/docs/A1099/V2/W9FormBaseResponse.md @@ -0,0 +1,44 @@ +# AvalaraSdk::A1099::V2::W9FormBaseResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier for the form. | [optional] | +| **type** | **String** | The form type. | [optional] | +| **entry_status** | **String** | The form status. | [optional] | +| **entry_status_date** | **Time** | The timestamp for the latest status update. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W9FormBaseResponse.new( + id: null, + type: null, + entry_status: null, + entry_status_date: null, + reference_id: null, + company_id: null, + display_name: null, + email: null, + archived: null, + signature: null, + signed_date: null, + e_delivery_consented_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/A1099/V2/W9FormDataModel.md b/docs/A1099/V2/W9FormDataModel.md new file mode 100644 index 0000000..7c834eb --- /dev/null +++ b/docs/A1099/V2/W9FormDataModel.md @@ -0,0 +1,440 @@ +# AvalaraSdk::A1099::V2::W9FormDataModel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of the form, always W9 for this model. | [optional][readonly] | +| **tin_match_status** | **String** | The status of the TIN match. | [optional] | +| **signature** | **String** | The signature itself | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **name** | **String** | The name of the individual or entity associated with the form. | [optional] | +| **business_classification** | **String** | The classification of the business. | [optional] | +| **business_name** | **String** | The name of the business associated with the form. | [optional] | +| **business_other** | **String** | | [optional] | +| **exempt_payee_code** | **String** | | [optional] | +| **exempt_fatca_code** | **String** | | [optional] | +| **type_of_tin** | **String** | The type of TIN provided. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **address** | **String** | The 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] | +| **foreign_country_indicator** | **Boolean** | Indicates whether the individual or entity is in a foreign country. | [optional] | +| **foreign_address** | **String** | The foreign address of the individual or entity. | [optional] | +| **backup_withholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **is1099able** | **Boolean** | | [optional] | +| **foreign_partner_owner_or_beneficiary** | **Boolean** | Indicates whether the individual is a foreign partner, owner, or beneficiary. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [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] | +| **employee_name_suffix** | **String** | The name suffix of the employee. | [optional] | +| **box3_marital_status** | **String** | The marital status of the employee. | [optional] | +| **box4_last_name_differs** | **Boolean** | Indicates whether the last name differs from prior records. | [optional] | +| **box5_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] | +| **box6_additional_withheld** | **Float** | The additional amount withheld. | [optional] | +| **box7_exempt_from_withholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | +| **office_code** | **String** | The office code associated with the form. | [optional] | +| **disregarded_entity_chapter4_fatca_status** | **String** | The FATCA status for disregarded entities under Chapter 4. | [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_postal_code** | **String** | The postal code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [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_postal_code** | **String** | The postal code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [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_postal_code** | **String** | The postal code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **foreign_tin** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **ftin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **giin** | **String** | The global intermediary identification number (GIIN). | [optional] | +| **chapter3_entity_type** | **String** | The Chapter 3 entity type. | [optional] | +| **chapter4_fatca_status** | **String** | The Chapter 4 FATCA status. | [optional] | +| **disregarded_entity** | **String** | The disregarded entity information. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **benefit_limitation** | **String** | The benefit limitation for tax treaty claims. | [optional] | +| **part4_sponsoring_entity** | **String** | The sponsoring entity information for Part 4. | [optional] | +| **part4_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 4. | [optional] | +| **part7_sponsoring_entity** | **String** | The sponsoring entity information for Part 7. | [optional] | +| **part12_iga_country** | **String** | The IGA country information for Part 12. | [optional] | +| **part12_iga_type** | **String** | The IGA type information for Part 12. | [optional] | +| **part12_fatca_status_under_iga_annex_ii** | **String** | The FATCA status under IGA Annex II for Part 12. | [optional] | +| **part12_trustee_name** | **String** | The trustee name for Part 12. | [optional] | +| **part12_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for Part 12. | [optional] | +| **part12_model2_iga_giin** | **String** | The GIIN for Model 2 IGA in Part 12. | [optional] | +| **box37_a_exchange** | **String** | The exchange information for Box 37A. | [optional] | +| **box37_b_exchange** | **String** | The exchange information for Box 37B. | [optional] | +| **box37_b_entity** | **String** | The entity information for Box 37B. | [optional] | +| **part28_sponsoring_entity** | **String** | The sponsoring entity information for Part 28. | [optional] | +| **part28_sponsoring_entity_giin** | **String** | The GIIN for the sponsoring entity in Part 28. | [optional] | +| **signer_name** | **String** | The name of the signer of the form. | [optional] | +| **residence_is_mailing** | **Boolean** | Indicates whether the residence address is also the mailing address. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **making_treaty_claim** | **Boolean** | | [optional] | +| **treaty_country** | **String** | The country for which the treaty applies. | [optional] | +| **treaty_article** | **String** | The specific article of the treaty being claimed. | [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] | +| **treaty_reasons** | **String** | The reasons for claiming treaty benefits. | [optional] | +| **certify_box14_a** | **Boolean** | | [optional] | +| **certify_box14_b** | **Boolean** | | [optional] | +| **certify_box14_c** | **Boolean** | | [optional] | +| **certify_box17_1** | **Boolean** | | [optional] | +| **certify_box17_2** | **Boolean** | | [optional] | +| **certify_box18** | **Boolean** | | [optional] | +| **certify_box19** | **Boolean** | | [optional] | +| **certify_box21** | **Boolean** | | [optional] | +| **certify_box22** | **Boolean** | Indicates certification for box 22. | [optional] | +| **certify_box23** | **Boolean** | | [optional] | +| **certify_box24_a** | **Boolean** | Indicates certification for box 24A. | [optional] | +| **certify_box24_b** | **Boolean** | Indicates certification for box 24B. | [optional] | +| **certify_box24_c** | **Boolean** | Indicates certification for box 24C. | [optional] | +| **certify_box24_d** | **Boolean** | | [optional] | +| **certify_box25_a** | **Boolean** | | [optional] | +| **certify_box25_b** | **Boolean** | | [optional] | +| **certify_box25_c** | **Boolean** | | [optional] | +| **certify_box26** | **Boolean** | Indicates certification for box 26. | [optional] | +| **certify_box27** | **Boolean** | | [optional] | +| **certify_box28_a** | **Boolean** | | [optional] | +| **certify_box28_b** | **Boolean** | | [optional] | +| **certify_box29_a** | **Boolean** | | [optional] | +| **certify_box29_b** | **Boolean** | | [optional] | +| **certify_box29_c** | **Boolean** | | [optional] | +| **certify_box29_d** | **Boolean** | | [optional] | +| **certify_box29_e** | **Boolean** | | [optional] | +| **certify_box29_f** | **Boolean** | | [optional] | +| **certify_box30** | **Boolean** | | [optional] | +| **certify_box31** | **Boolean** | Indicates certification for box 31. | [optional] | +| **certify_box32** | **Boolean** | Indicates certification for box 32. | [optional] | +| **certify_box33** | **Boolean** | | [optional] | +| **certify_box34** | **Boolean** | Indicates certification for box 34. | [optional] | +| **certify_box35** | **Boolean** | Indicates certification for box 35. | [optional] | +| **certify_box36** | **Boolean** | Indicates certification for box 36. | [optional] | +| **certify_box37_a** | **Boolean** | Indicates certification for box 37A. | [optional] | +| **certify_box37_b** | **Boolean** | Indicates certification for box 37B. | [optional] | +| **certify_box38** | **Boolean** | Indicates certification for box 38. | [optional] | +| **certify_box39** | **Boolean** | Indicates certification for box 39. | [optional] | +| **certify_box40_a** | **Boolean** | | [optional] | +| **certify_box40_b** | **Boolean** | | [optional] | +| **certify_box40_c** | **Boolean** | | [optional] | +| **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] | +| **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] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **Integer** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **signer_capacity** | **String** | The capacity in which the signer is signing the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | +| **ein** | **String** | The employer identification number (EIN). | [optional] | +| **ein_type** | **String** | The type of employer identification number (EIN). | [optional] | +| **certify_box14** | **Boolean** | Indicates certification for box 14. | [optional] | +| **certify_box15_a** | **Boolean** | Indicates certification for box 15A. | [optional] | +| **certify_box15_b** | **Boolean** | Indicates certification for box 15B. | [optional] | +| **certify_box15_c** | **Boolean** | Indicates certification for box 15C. | [optional] | +| **certify_box15_d** | **Boolean** | Indicates certification for box 15D. | [optional] | +| **certify_box15_e** | **Boolean** | Indicates certification for box 15E. | [optional] | +| **certify_box15_f** | **Boolean** | Indicates certification for box 15F. | [optional] | +| **certify_box15_g** | **Boolean** | Indicates certification for box 15G. | [optional] | +| **certify_box15_h** | **Boolean** | Indicates certification for box 15H. | [optional] | +| **certify_box15_i** | **Boolean** | Indicates certification for box 15I. | [optional] | +| **certify_box16_a** | **Boolean** | Indicates certification for box 16A. | [optional] | +| **box16_b_qdd_corporate** | **Boolean** | Indicates certification for box 16B as a QDD corporate entity. | [optional] | +| **box16_b_qdd_partnership** | **Boolean** | Indicates certification for box 16B as a QDD partnership. | [optional] | +| **box16_b_qdd_disregarded_entity** | **Boolean** | Indicates certification for box 16B as a QDD disregarded entity. | [optional] | +| **certify_box17_a** | **Boolean** | Indicates certification for box 17A. | [optional] | +| **certify_box17_b** | **Boolean** | Indicates certification for box 17B. | [optional] | +| **certify_box17_c** | **Boolean** | Indicates certification for box 17C. | [optional] | +| **certify_box17_d** | **Boolean** | Indicates certification for box 17D. | [optional] | +| **certify_box17_e** | **Boolean** | Indicates certification for box 17E. | [optional] | +| **certify_box18_a** | **Boolean** | Indicates certification for box 18A. | [optional] | +| **certify_box18_b** | **Boolean** | Indicates certification for box 18B. | [optional] | +| **certify_box18_c** | **Boolean** | Indicates certification for box 18C. | [optional] | +| **certify_box18_d** | **Boolean** | Indicates certification for box 18D. | [optional] | +| **certify_box18_e** | **Boolean** | Indicates certification for box 18E. | [optional] | +| **certify_box18_f** | **Boolean** | Indicates certification for box 18F. | [optional] | +| **certify_box19_a** | **Boolean** | Indicates certification for box 19A. | [optional] | +| **certify_box19_b** | **Boolean** | Indicates certification for box 19B. | [optional] | +| **certify_box19_c** | **Boolean** | Indicates certification for box 19C. | [optional] | +| **certify_box19_d** | **Boolean** | Indicates certification for box 19D. | [optional] | +| **certify_box19_e** | **Boolean** | Indicates certification for box 19E. | [optional] | +| **certify_box19_f** | **Boolean** | Indicates certification for box 19F. | [optional] | +| **certify_box20** | **Boolean** | Indicates certification for box 20. | [optional] | +| **certify_box21_a** | **Boolean** | Indicates certification for box 21A. | [optional] | +| **certify_box21_b** | **Boolean** | Indicates certification for box 21B. | [optional] | +| **certify_box21_c** | **Boolean** | Indicates certification for box 21C. | [optional] | +| **certify_box21_d** | **Boolean** | Indicates certification for box 21D. | [optional] | +| **certify_box21_e** | **Boolean** | Indicates certification for box 21E. | [optional] | +| **certify_box21_f** | **Boolean** | Indicates certification for box 21F. | [optional] | +| **box23_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 23A. | [optional] | +| **certify_box23_b** | **Boolean** | Indicates certification for box 23B. | [optional] | +| **certify_box23_c** | **Boolean** | Indicates certification for box 23C. | [optional] | +| **certify_box25** | **Boolean** | Indicates certification for box 25. | [optional] | +| **box27_a_name_sponsoring_entity** | **String** | The name of the sponsoring entity for box 27A. | [optional] | +| **certify_box27_b** | **Boolean** | Indicates certification for box 27B. | [optional] | +| **certify_box28** | **Boolean** | Indicates certification for box 28. | [optional] | +| **certify_box29** | **Boolean** | Indicates certification for box 29. | [optional] | +| **certify_box30_a** | **Boolean** | Indicates certification for box 30A. | [optional] | +| **certify_box30_b** | **Boolean** | Indicates certification for box 30B. | [optional] | +| **certify_box30_c** | **Boolean** | Indicates certification for box 30C. | [optional] | +| **box32_iga_country** | **String** | The IGA country information for box 32. | [optional] | +| **box32_iga_type** | **String** | The IGA type information for box 32. | [optional] | +| **box32_iga_treated_as** | **String** | The IGA treatment information for box 32. | [optional] | +| **box32_trustee_or_sponsor** | **String** | The trustee or sponsor information for box 32. | [optional] | +| **box32_trustee_is_foreign** | **Boolean** | Indicates whether the trustee is foreign for box 32. | [optional] | +| **certify_box33_a** | **Boolean** | Indicates certification for box 33A. | [optional] | +| **certify_box33_b** | **Boolean** | Indicates certification for box 33B. | [optional] | +| **certify_box33_c** | **Boolean** | Indicates certification for box 33C. | [optional] | +| **certify_box33_d** | **Boolean** | Indicates certification for box 33D. | [optional] | +| **certify_box33_e** | **Boolean** | Indicates certification for box 33E. | [optional] | +| **certify_box33_f** | **Boolean** | Indicates certification for box 33F. | [optional] | +| **box37_a_securities_market** | **String** | The securities market information for box 37A. | [optional] | +| **box37_b_name_of_entity** | **String** | The name of the entity for box 37B. | [optional] | +| **box37_b_securities_market** | **String** | The securities market information for box 37B. | [optional] | +| **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] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W9FormDataModel.new( + type: w9, + tin_match_status: Match, + signature: null, + signed_date: 2022-04-29T15:19:42Z, + name: John Doe, + business_classification: LLC, + business_name: Doe Enterprises, + business_other: null, + exempt_payee_code: null, + exempt_fatca_code: null, + type_of_tin: EIN, + tin: 12-3456789, + address: 123 Main St, + city: Anytown, + state: CA, + zip: 90210, + account_number: ACC123456, + foreign_country_indicator: false, + foreign_address: null, + backup_withholding: false, + e_delivery_consented_at: 2022-04-29T15:19:42Z, + is1099able: null, + foreign_partner_owner_or_beneficiary: false, + created_at: 2022-04-29T15:19:42Z, + employee_first_name: Jane, + employee_middle_name: A., + employee_last_name: Smith, + employee_name_suffix: Jr., + box3_marital_status: Married, + box4_last_name_differs: false, + box5_num_allowances: 3, + other_dependents: 1, + non_job_income: 5000.0, + deductions: 2000.0, + box6_additional_withheld: 150.0, + box7_exempt_from_withholding: false, + office_code: OC12345, + disregarded_entity_chapter4_fatca_status: null, + residence_address: 321 Wealth Ave, + residence_city: Finance City, + residence_state: TX, + residence_postal_code: 75001, + residence_country: USA, + mailing_address: P.O. Box 789, + mailing_city: Finance City, + mailing_state: TX, + mailing_postal_code: 75002, + mailing_country: USA, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_postal_code: null, + disregarded_country: null, + foreign_tin: null, + ftin_not_required: null, + reference_number: W8IMY56789, + giin: null, + chapter3_entity_type: Partnership, + chapter4_fatca_status: Compliant, + disregarded_entity: Subsidiary Finance, + disregarded_entity_giin: GIIN78901234, + benefit_limitation: Treaty Benefit, + part4_sponsoring_entity: Parent Company, + part4_sponsoring_entity_giin: GIIN11223344, + part7_sponsoring_entity: Affiliated Organization, + part12_iga_country: USA, + part12_iga_type: Model 1, + part12_fatca_status_under_iga_annex_ii: Registered Deemed Compliant, + part12_trustee_name: Trustee Inc., + part12_trustee_is_foreign: false, + part12_model2_iga_giin: GIIN33445566, + box37_a_exchange: NYSE, + box37_b_exchange: NASDAQ, + box37_b_entity: Trading Partner, + part28_sponsoring_entity: Global Trust, + part28_sponsoring_entity_giin: GIIN99887766, + signer_name: Richard Roe, + residence_is_mailing: false, + citizenship_country: USA, + making_treaty_claim: false, + treaty_country: Canada, + treaty_article: Article 12, + withholding_rate: 15%, + income_type: Dividend, + treaty_reasons: Reduced withholding, + certify_box14_a: false, + certify_box14_b: false, + certify_box14_c: false, + certify_box17_1: false, + certify_box17_2: false, + certify_box18: false, + certify_box19: false, + certify_box21: false, + certify_box22: false, + certify_box23: false, + certify_box24_a: false, + certify_box24_b: false, + certify_box24_c: false, + certify_box24_d: false, + certify_box25_a: false, + certify_box25_b: false, + certify_box25_c: false, + certify_box26: false, + certify_box27: false, + certify_box28_a: false, + certify_box28_b: false, + certify_box29_a: false, + certify_box29_b: false, + certify_box29_c: false, + certify_box29_d: false, + certify_box29_e: false, + certify_box29_f: false, + certify_box30: false, + certify_box31: false, + certify_box32: false, + certify_box33: false, + certify_box34: false, + certify_box35: false, + certify_box36: false, + certify_box37_a: false, + certify_box37_b: false, + certify_box38: false, + certify_box39: false, + certify_box40_a: false, + certify_box40_b: false, + certify_box40_c: false, + certify_box41: false, + certify_box43: false, + certify_part29_signature: false, + part19_formation_or_resolution_date: null, + part20_filing_date: null, + part21_determination_date: null, + substantial_us_owners: [], + birthday: null, + foreign_tin_not_required: null, + archived: false, + reference_id: REF67890, + company_id: 4004, + display_name: Global Financials, + email: contact@globalfinancials.com, + signer_capacity: Authorized Representative, + updated_at: 2023-06-20T14:30Z, + ein: null, + ein_type: null, + certify_box14: false, + certify_box15_a: false, + certify_box15_b: false, + certify_box15_c: false, + certify_box15_d: false, + certify_box15_e: false, + certify_box15_f: false, + certify_box15_g: false, + certify_box15_h: false, + certify_box15_i: false, + certify_box16_a: false, + box16_b_qdd_corporate: false, + box16_b_qdd_partnership: false, + box16_b_qdd_disregarded_entity: false, + certify_box17_a: false, + certify_box17_b: false, + certify_box17_c: false, + certify_box17_d: false, + certify_box17_e: false, + certify_box18_a: false, + certify_box18_b: false, + certify_box18_c: false, + certify_box18_d: false, + certify_box18_e: false, + certify_box18_f: false, + certify_box19_a: false, + certify_box19_b: false, + certify_box19_c: false, + certify_box19_d: false, + certify_box19_e: false, + certify_box19_f: false, + certify_box20: false, + certify_box21_a: false, + certify_box21_b: false, + certify_box21_c: false, + certify_box21_d: false, + certify_box21_e: false, + certify_box21_f: false, + box23_a_name_sponsoring_entity: null, + certify_box23_b: false, + certify_box23_c: false, + certify_box25: false, + box27_a_name_sponsoring_entity: null, + certify_box27_b: false, + certify_box28: false, + certify_box29: false, + certify_box30_a: false, + certify_box30_b: false, + certify_box30_c: false, + box32_iga_country: null, + box32_iga_type: null, + box32_iga_treated_as: null, + box32_trustee_or_sponsor: null, + box32_trustee_is_foreign: false, + certify_box33_a: false, + certify_box33_b: false, + certify_box33_c: false, + certify_box33_d: false, + certify_box33_e: false, + certify_box33_f: false, + box37_a_securities_market: null, + box37_b_name_of_entity: null, + box37_b_securities_market: null, + certify_box40: false, + box41_sponsoring_entity: null, + certify_box42: false, + box35_formed_on_date: null, + box36_filed_on_date: null +) +``` + diff --git a/docs/A1099/V2/W9FormResponse.md b/docs/A1099/V2/W9FormResponse.md new file mode 100644 index 0000000..23f0cc9 --- /dev/null +++ b/docs/A1099/V2/W9FormResponse.md @@ -0,0 +1,80 @@ +# AvalaraSdk::A1099::V2::W9FormResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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] | +| **id** | **String** | The unique identifier for the form. | [optional] | +| **type** | **String** | The form type. | [optional] | +| **entry_status** | **String** | The form status. | [optional] | +| **entry_status_date** | **Time** | The timestamp for the latest status update. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **display_name** | **String** | The display name associated with the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | +| **signed_date** | **Time** | The date the form was signed. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **created_at** | **Time** | The creation date of the form. | [optional] | +| **updated_at** | **Time** | The last updated date of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W9FormResponse.new( + name: John Doe, + business_name: Doe Enterprises, + business_classification: LLC, + business_other: null, + foreign_partner_owner_or_beneficiary: false, + exempt_payee_code: null, + exempt_fatca_code: null, + foreign_country_indicator: false, + address: 123 Main St, + foreign_address: null, + city: Anytown, + state: CA, + zip: 90210, + account_number: ACC123456, + tin_type: EIN, + tin: 12-3456789, + backup_withholding: false, + is1099able: true, + id: null, + type: null, + entry_status: null, + entry_status_date: null, + reference_id: null, + company_id: null, + display_name: null, + email: null, + archived: null, + signature: null, + signed_date: null, + e_delivery_consented_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/docs/EInvoicing/V1/BadDownloadRequest.md b/docs/EInvoicing/V1/BadDownloadRequest.md index 7a2d938..f8664dc 100644 --- a/docs/EInvoicing/V1/BadDownloadRequest.md +++ b/docs/EInvoicing/V1/BadDownloadRequest.md @@ -19,4 +19,4 @@ instance = AvalaraSdk::EInvoicing::V1::BadDownloadRequest.new( supported_accept_headers: ["application/vnd.oasis.ubl+xml","application/pdf"] ) ``` - + diff --git a/docs/EInvoicing/V1/BadRequest.md b/docs/EInvoicing/V1/BadRequest.md index 208f792..f47e1e4 100644 --- a/docs/EInvoicing/V1/BadRequest.md +++ b/docs/EInvoicing/V1/BadRequest.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::BadRequest.new( message: string ) ``` - + diff --git a/docs/EInvoicing/V1/BatchSearch.md b/docs/EInvoicing/V1/BatchSearch.md index f7b3b9a..cd338b8 100644 --- a/docs/EInvoicing/V1/BatchSearch.md +++ b/docs/EInvoicing/V1/BatchSearch.md @@ -18,13 +18,13 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::BatchSearch.new( - id: 2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99, - name: Batch Search Report 1, - created_by: user@example.com, - created: 2024-08-01T12:34:56Z, - last_modified: 2024-08-01T12:34:56Z, - status: Accepted, + id: null, + name: null, + created_by: null, + created: null, + last_modified: null, + status: null, error: null ) ``` - + diff --git a/docs/EInvoicing/V1/BatchSearchListResponse.md b/docs/EInvoicing/V1/BatchSearchListResponse.md index 9bacdda..84bd2c0 100644 --- a/docs/EInvoicing/V1/BatchSearchListResponse.md +++ b/docs/EInvoicing/V1/BatchSearchListResponse.md @@ -14,9 +14,9 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::BatchSearchListResponse.new( - record_set_count: 500, - next_link: TODO, + record_set_count: null, + next_link: null, value: null ) ``` - + diff --git a/docs/EInvoicing/V1/BatchSearchParticipants202Response.md b/docs/EInvoicing/V1/BatchSearchParticipants202Response.md new file mode 100644 index 0000000..3ee8927 --- /dev/null +++ b/docs/EInvoicing/V1/BatchSearchParticipants202Response.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::BatchSearchParticipants202Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique ID of the batch search. | [optional] | +| **status** | **String** | Status of the batch search. | [optional] | +| **message** | **String** | A message indicating that the batch search request has been accepted. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::BatchSearchParticipants202Response.new( + id: 2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99, + status: Accepted for processing, + message: File uploaded successfully, you will be notified once the search results are ready. +) +``` + diff --git a/docs/EInvoicing/V1/ConditionalForField.md b/docs/EInvoicing/V1/ConditionalForField.md index 6a0057c..c38fdac 100644 --- a/docs/EInvoicing/V1/ConditionalForField.md +++ b/docs/EInvoicing/V1/ConditionalForField.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::ConditionalForField.new( required_when: null ) ``` - + diff --git a/docs/EInvoicing/V1/DataInputField.md b/docs/EInvoicing/V1/DataInputField.md index c504eb5..5887a78 100644 --- a/docs/EInvoicing/V1/DataInputField.md +++ b/docs/EInvoicing/V1/DataInputField.md @@ -43,4 +43,4 @@ instance = AvalaraSdk::EInvoicing::V1::DataInputField.new( optional_for: null ) ``` - + diff --git a/docs/EInvoicing/V1/DataInputFieldNotUsedFor.md b/docs/EInvoicing/V1/DataInputFieldNotUsedFor.md index ea6acfd..e580948 100644 --- a/docs/EInvoicing/V1/DataInputFieldNotUsedFor.md +++ b/docs/EInvoicing/V1/DataInputFieldNotUsedFor.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::DataInputFieldNotUsedFor.new( country_mandate: null ) ``` - + diff --git a/docs/EInvoicing/V1/DataInputFieldOptionalFor.md b/docs/EInvoicing/V1/DataInputFieldOptionalFor.md index 0c369ce..61c2246 100644 --- a/docs/EInvoicing/V1/DataInputFieldOptionalFor.md +++ b/docs/EInvoicing/V1/DataInputFieldOptionalFor.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::DataInputFieldOptionalFor.new( country_mandate: null ) ``` - + diff --git a/docs/EInvoicing/V1/DataInputFieldRequiredFor.md b/docs/EInvoicing/V1/DataInputFieldRequiredFor.md index 6a89d49..8c5efd1 100644 --- a/docs/EInvoicing/V1/DataInputFieldRequiredFor.md +++ b/docs/EInvoicing/V1/DataInputFieldRequiredFor.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::DataInputFieldRequiredFor.new( country_mandate: null ) ``` - + diff --git a/docs/EInvoicing/V1/DataInputFieldsApi.md b/docs/EInvoicing/V1/DataInputFieldsApi.md index 9e4fb00..52be7e0 100644 --- a/docs/EInvoicing/V1/DataInputFieldsApi.md +++ b/docs/EInvoicing/V1/DataInputFieldsApi.md @@ -1,97 +1,97 @@ -# AvalaraSdk::EInvoicing::V1::DataInputFieldsApi - -All URIs are relative to *https://api.sbx.avalara.com/einvoicing* - -| Method | HTTP request | Description | -| ------ | ------------ | ----------- | -| [**get_data_input_fields**](DataInputFieldsApi.md#get_data_input_fields) | **GET** /data-input-fields | Returns the optionality of document fields for different country mandates | - - -## get_data_input_fields - -> get_data_input_fields(avalara_version, opts) - -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 - -### 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::DataInputFieldsApi.new api_client - -avalara_version = '1.2' # 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: 10, # Float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. - skip: 10, # Float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. - 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 -} - -begin - # Returns the optionality of document fields for different country mandates - result = api_instance.get_data_input_fields(avalara_version, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling DataInputFieldsApi->get_data_input_fields: #{e}" -end -``` - -#### Using the get_data_input_fields_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_data_input_fields_with_http_info(avalara_version, opts) - -```ruby -begin - # Returns the optionality of document fields for different country mandates - data, status_code, headers = api_instance.get_data_input_fields_with_http_info(avalara_version, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling DataInputFieldsApi->get_data_input_fields_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 | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | -| **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] | -| **top** | **Float** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] | -| **skip** | **Float** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | -| **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] | - -### Return type - -[**DataInputFieldsResponse**](DataInputFieldsResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - +# AvalaraSdk::EInvoicing::V1::DataInputFieldsApi + +All URIs are relative to *https://api.sbx.avalara.com/einvoicing* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_data_input_fields**](DataInputFieldsApi.md#get_data_input_fields) | **GET** /data-input-fields | Returns the optionality of document fields for different country mandates | + + +## get_data_input_fields + +> get_data_input_fields(avalara_version, opts) + +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 + +### 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::DataInputFieldsApi.new api_client + +avalara_version = '1.2' # 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: 10, # Float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + skip: 10, # Float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + 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 +} + +begin + # Returns the optionality of document fields for different country mandates + result = api_instance.get_data_input_fields(avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling DataInputFieldsApi->get_data_input_fields: #{e}" +end +``` + +#### Using the get_data_input_fields_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_data_input_fields_with_http_info(avalara_version, opts) + +```ruby +begin + # Returns the optionality of document fields for different country mandates + data, status_code, headers = api_instance.get_data_input_fields_with_http_info(avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling DataInputFieldsApi->get_data_input_fields_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 | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | +| **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] | +| **top** | **Float** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] | +| **skip** | **Float** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **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] | + +### Return type + +[**DataInputFieldsResponse**](DataInputFieldsResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/DataInputFieldsResponse.md b/docs/EInvoicing/V1/DataInputFieldsResponse.md index 040a60e..e31635a 100644 --- a/docs/EInvoicing/V1/DataInputFieldsResponse.md +++ b/docs/EInvoicing/V1/DataInputFieldsResponse.md @@ -19,4 +19,4 @@ instance = AvalaraSdk::EInvoicing::V1::DataInputFieldsResponse.new( value: null ) ``` - + diff --git a/docs/EInvoicing/V1/DirectorySearchResponse.md b/docs/EInvoicing/V1/DirectorySearchResponse.md index 821ad00..1540098 100644 --- a/docs/EInvoicing/V1/DirectorySearchResponse.md +++ b/docs/EInvoicing/V1/DirectorySearchResponse.md @@ -14,9 +14,9 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::DirectorySearchResponse.new( - record_set_count: 500, - next_link: TODO, + record_set_count: null, + next_link: null, value: null ) ``` - + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md index edb9fca..e90a96e 100644 --- a/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md @@ -18,13 +18,13 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::DirectorySearchResponseValueInner.new( - id: 2a27ee0cf5bcb6165ab891503652343419a8fc5fe6b406299c47d7b44aa8548c, - name: Pineapple Labs ltd, - network: Peppol, + id: null, + name: null, + network: null, registration_date: null, identifiers: null, addresses: null, supported_document_types: null ) ``` - + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md index d52e646..53cffeb 100644 --- a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md @@ -16,11 +16,11 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::DirectorySearchResponseValueInnerAddressesInner.new( - line1: , - line2: , - city: , - state: , - country: + line1: null, + line2: null, + city: null, + state: null, + country: null ) ``` - + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md index 896dbb8..ce2b787 100644 --- a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md @@ -13,8 +13,8 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::DirectorySearchResponseValueInnerIdentifiersInner.new( - name: PeppolParticipantId, - value: 9930:de112233445 + name: null, + value: null ) ``` - + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md index 9a29a24..719eba8 100644 --- a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md @@ -15,10 +15,10 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::DirectorySearchResponseValueInnerSupportedDocumentTypesInner.new( - name: Peppol BIS Billing UBL Invoice V3, - value: busdox-docid-qns::urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1, - supported_by_trading_partner: true, - supported_by_avalara: true + name: null, + value: null, + supported_by_trading_partner: null, + supported_by_avalara: null ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentFetch.md b/docs/EInvoicing/V1/DocumentFetch.md index 4efcde9..75f793e 100644 --- a/docs/EInvoicing/V1/DocumentFetch.md +++ b/docs/EInvoicing/V1/DocumentFetch.md @@ -19,4 +19,4 @@ instance = AvalaraSdk::EInvoicing::V1::DocumentFetch.new( event_date_time: 2024-05-27T14:20:07:723 ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentListResponse.md b/docs/EInvoicing/V1/DocumentListResponse.md index 1b6cb9b..f6769db 100644 --- a/docs/EInvoicing/V1/DocumentListResponse.md +++ b/docs/EInvoicing/V1/DocumentListResponse.md @@ -19,4 +19,4 @@ instance = AvalaraSdk::EInvoicing::V1::DocumentListResponse.new( value: null ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentStatusResponse.md b/docs/EInvoicing/V1/DocumentStatusResponse.md index 99c44d4..c9e6c1b 100644 --- a/docs/EInvoicing/V1/DocumentStatusResponse.md +++ b/docs/EInvoicing/V1/DocumentStatusResponse.md @@ -19,4 +19,4 @@ instance = AvalaraSdk::EInvoicing::V1::DocumentStatusResponse.new( events: null ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentSubmissionError.md b/docs/EInvoicing/V1/DocumentSubmissionError.md index aeae927..23a711b 100644 --- a/docs/EInvoicing/V1/DocumentSubmissionError.md +++ b/docs/EInvoicing/V1/DocumentSubmissionError.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::DocumentSubmissionError.new( message: Failed to parse document ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentSubmitResponse.md b/docs/EInvoicing/V1/DocumentSubmitResponse.md index 34168d9..7593e62 100644 --- a/docs/EInvoicing/V1/DocumentSubmitResponse.md +++ b/docs/EInvoicing/V1/DocumentSubmitResponse.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::DocumentSubmitResponse.new( id: 52f60401-44d0-4667-ad47-4afe519abb53 ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentSummary.md b/docs/EInvoicing/V1/DocumentSummary.md index ba01559..38ce393 100644 --- a/docs/EInvoicing/V1/DocumentSummary.md +++ b/docs/EInvoicing/V1/DocumentSummary.md @@ -5,6 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **id** | **String** | The unique ID for this document | [optional] | +| **company_id** | **String** | Unique identifier that represents the company within the system. | [optional] | | **process_date_time** | **String** | The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss | [optional] | | **status** | **String** | The Document status | [optional] | | **supplier_name** | **String** | The name of the supplier in the transaction | [optional] | @@ -26,6 +27,7 @@ require 'avalara_sdk' instance = AvalaraSdk::EInvoicing::V1::DocumentSummary.new( id: 52f60401-44d0-4667-ad47-4afe519abb53, + company_id: a5869a7b-4d5d-4ec1-9b29-fd272aa58ab2, process_date_time: 2022-01-09T12:36:02, status: Complete, supplier_name: Inposia GmbH, @@ -41,4 +43,4 @@ instance = AvalaraSdk::EInvoicing::V1::DocumentSummary.new( receiver: 9930:AVALARATEST ) ``` - + diff --git a/docs/EInvoicing/V1/DocumentsApi.md b/docs/EInvoicing/V1/DocumentsApi.md index 76c8513..2956f86 100644 --- a/docs/EInvoicing/V1/DocumentsApi.md +++ b/docs/EInvoicing/V1/DocumentsApi.md @@ -1,435 +1,435 @@ -# AvalaraSdk::EInvoicing::V1::DocumentsApi - -All URIs are relative to *https://api.sbx.avalara.com/einvoicing* - -| Method | HTTP request | Description | -| ------ | ------------ | ----------- | -| [**download_document**](DocumentsApi.md#download_document) | **GET** /documents/{documentId}/$download | Returns a copy of the document | -| [**fetch_documents**](DocumentsApi.md#fetch_documents) | **POST** /documents/$fetch | Fetch the inbound document from a tax authority | -| [**get_document_list**](DocumentsApi.md#get_document_list) | **GET** /documents | Returns a summary of documents for a date range | -| [**get_document_status**](DocumentsApi.md#get_document_status) | **GET** /documents/{documentId}/status | Checks the status of a document | -| [**submit_document**](DocumentsApi.md#submit_document) | **POST** /documents | Submits a document to Avalara E-Invoicing API | - - -## download_document - -> File download_document(avalara_version, accept, document_id, opts) - -Returns a copy of the document - -When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned. - -### 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::DocumentsApi.new api_client - -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -accept = 'application/pdf' # String | This header indicates the MIME type of the document -document_id = 'document_id_example' # String | The unique ID for this document that was returned in the POST /einvoicing/document response body -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. -} - -begin - # Returns a copy of the document - result = api_instance.download_document(avalara_version, accept, document_id, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling DocumentsApi->download_document: #{e}" -end -``` - -#### Using the download_document_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> download_document_with_http_info(avalara_version, accept, document_id, opts) - -```ruby -begin - # Returns a copy of the document - data, status_code, headers = api_instance.download_document_with_http_info(avalara_version, accept, document_id, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => File -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling DocumentsApi->download_document_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 | | -| **accept** | **String** | This header indicates the MIME type of the document | | -| **document_id** | **String** | The unique ID for this document that was returned in the POST /einvoicing/document response body | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | - -### Return type - -**File** - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/pdf, application/xml, application/json - - -## fetch_documents - -> fetch_documents(avalara_version, document_fetch_request, opts) - -Fetch the inbound document from a tax authority - -This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number. - -### 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::DocumentsApi.new api_client - -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -document_fetch_request = AvalaraSdk::EInvoicing::V1::DocumentFetchRequest.new # DocumentFetchRequest | -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. -} - -begin - # Fetch the inbound document from a tax authority - result = api_instance.fetch_documents(avalara_version, document_fetch_request, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling DocumentsApi->fetch_documents: #{e}" -end -``` - -#### Using the fetch_documents_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> fetch_documents_with_http_info(avalara_version, document_fetch_request, opts) - -```ruby -begin - # Fetch the inbound document from a tax authority - data, status_code, headers = api_instance.fetch_documents_with_http_info(avalara_version, document_fetch_request, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling DocumentsApi->fetch_documents_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 | | -| **document_fetch_request** | [**DocumentFetchRequest**](DocumentFetchRequest.md) | | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | - -### Return type - -[**DocumentFetch**](DocumentFetch.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## get_document_list - -> get_document_list(avalara_version, opts) - -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. - -### 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::DocumentsApi.new api_client - -avalara_version = '1.2' # 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. - end_date: Time.parse('2013-10-20T19:20:30+01:00'), # Time | End date of documents to return. This defaults to the current date. - flow: 'out', # String | Optionally filter by document direction, where issued = `out` and received = `in` - count: 'true', # String | When set to true, the count of the collection is also returned in the response body - count_only: 'false', # String | When set to true, only the count of the collection is returned - filter: 'id eq 52f60401-44d0-4667-ad47-4afe519abb53', # String | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. - top: 10, # Float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. - skip: '10' # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. -} - -begin - # Returns a summary of documents for a date range - result = api_instance.get_document_list(avalara_version, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling DocumentsApi->get_document_list: #{e}" -end -``` - -#### Using the get_document_list_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_document_list_with_http_info(avalara_version, opts) - -```ruby -begin - # Returns a summary of documents for a date range - data, status_code, headers = api_instance.get_document_list_with_http_info(avalara_version, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling DocumentsApi->get_document_list_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 | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | -| **start_date** | **Time** | Start date of documents to return. This defaults to the previous month. | [optional] | -| **end_date** | **Time** | End date of documents to return. This defaults to the current date. | [optional] | -| **flow** | **String** | Optionally filter by document direction, where issued = `out` and received = `in` | [optional] | -| **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** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | - -### Return type - -[**DocumentListResponse**](DocumentListResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_document_status - -> get_document_status(avalara_version, document_id, opts) - -Checks the status of a document - -Using the unique ID from POST /einvoicing/documents response body, request the current status of a document. - -### 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::DocumentsApi.new api_client - -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -document_id = 'document_id_example' # String | The unique ID for this document that was returned in the POST /einvoicing/documents response body -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. -} - -begin - # Checks the status of a document - result = api_instance.get_document_status(avalara_version, document_id, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling DocumentsApi->get_document_status: #{e}" -end -``` - -#### Using the get_document_status_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_document_status_with_http_info(avalara_version, document_id, opts) - -```ruby -begin - # Checks the status of a document - data, status_code, headers = api_instance.get_document_status_with_http_info(avalara_version, document_id, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling DocumentsApi->get_document_status_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 | | -| **document_id** | **String** | The unique ID for this document that was returned in the POST /einvoicing/documents response body | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | - -### Return type - -[**DocumentStatusResponse**](DocumentStatusResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## submit_document - -> submit_document(avalara_version, metadata, data, opts) - -Submits a document to Avalara E-Invoicing API - -When a UBL document is sent to this endpoint, it generates a document in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.

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

Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. - -### 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::DocumentsApi.new api_client - -avalara_version = '1.2' # 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 = 'data_example' # String | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' -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. -} - -begin - # Submits a document to Avalara E-Invoicing API - result = api_instance.submit_document(avalara_version, metadata, data, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling DocumentsApi->submit_document: #{e}" -end -``` - -#### Using the submit_document_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> submit_document_with_http_info(avalara_version, metadata, data, opts) - -```ruby -begin - # Submits a document to Avalara E-Invoicing API - data, status_code, headers = api_instance.submit_document_with_http_info(avalara_version, metadata, data, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling DocumentsApi->submit_document_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 | | -| **metadata** | [**SubmitDocumentMetadata**](SubmitDocumentMetadata.md) | | | -| **data** | **String** | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | - -### Return type - -[**DocumentSubmitResponse**](DocumentSubmitResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json, text/xml - +# AvalaraSdk::EInvoicing::V1::DocumentsApi + +All URIs are relative to *https://api.sbx.avalara.com/einvoicing* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**download_document**](DocumentsApi.md#download_document) | **GET** /documents/{documentId}/$download | Returns a copy of the document | +| [**fetch_documents**](DocumentsApi.md#fetch_documents) | **POST** /documents/$fetch | Fetch the inbound document from a tax authority | +| [**get_document_list**](DocumentsApi.md#get_document_list) | **GET** /documents | Returns a summary of documents for a date range | +| [**get_document_status**](DocumentsApi.md#get_document_status) | **GET** /documents/{documentId}/status | Checks the status of a document | +| [**submit_document**](DocumentsApi.md#submit_document) | **POST** /documents | Submits a document to Avalara E-Invoicing API | + + +## download_document + +> File download_document(avalara_version, accept, document_id, opts) + +Returns a copy of the document + +When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned. + +### 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::DocumentsApi.new api_client + +avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +accept = 'application/pdf' # String | This header indicates the MIME type of the document +document_id = 'document_id_example' # String | The unique ID for this document that was returned in the POST /einvoicing/document response body +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. +} + +begin + # Returns a copy of the document + result = api_instance.download_document(avalara_version, accept, document_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling DocumentsApi->download_document: #{e}" +end +``` + +#### Using the download_document_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> download_document_with_http_info(avalara_version, accept, document_id, opts) + +```ruby +begin + # Returns a copy of the document + data, status_code, headers = api_instance.download_document_with_http_info(avalara_version, accept, document_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling DocumentsApi->download_document_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 | | +| **accept** | **String** | This header indicates the MIME type of the document | | +| **document_id** | **String** | The unique ID for this document that was returned in the POST /einvoicing/document response body | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | + +### Return type + +**File** + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf, application/xml, application/json + + +## fetch_documents + +> fetch_documents(avalara_version, fetch_documents_request, opts) + +Fetch the inbound document from a tax authority + +This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number. + +### 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::DocumentsApi.new api_client + +avalara_version = '1.2' # 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. +} + +begin + # Fetch the inbound document from a tax authority + result = api_instance.fetch_documents(avalara_version, fetch_documents_request, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling DocumentsApi->fetch_documents: #{e}" +end +``` + +#### Using the fetch_documents_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> fetch_documents_with_http_info(avalara_version, fetch_documents_request, opts) + +```ruby +begin + # Fetch the inbound document from a tax authority + data, status_code, headers = api_instance.fetch_documents_with_http_info(avalara_version, fetch_documents_request, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling DocumentsApi->fetch_documents_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 | | +| **fetch_documents_request** | [**FetchDocumentsRequest**](FetchDocumentsRequest.md) | | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | + +### Return type + +[**DocumentFetch**](DocumentFetch.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_document_list + +> get_document_list(avalara_version, opts) + +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. + +### 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::DocumentsApi.new api_client + +avalara_version = '1.2' # 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. + end_date: Time.parse('2013-10-20T19:20:30+01:00'), # Time | End date of documents to return. This defaults to the current date. + flow: 'out', # String | Optionally filter by document direction, where issued = `out` and received = `in` + count: 'true', # String | When set to true, the count of the collection is also returned in the response body + count_only: 'false', # String | When set to true, only the count of the collection is returned + filter: 'id eq 52f60401-44d0-4667-ad47-4afe519abb53', # String | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. + top: 10, # Float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. + skip: '10' # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. +} + +begin + # Returns a summary of documents for a date range + result = api_instance.get_document_list(avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling DocumentsApi->get_document_list: #{e}" +end +``` + +#### Using the get_document_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_document_list_with_http_info(avalara_version, opts) + +```ruby +begin + # Returns a summary of documents for a date range + data, status_code, headers = api_instance.get_document_list_with_http_info(avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling DocumentsApi->get_document_list_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 | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | +| **start_date** | **Time** | Start date of documents to return. This defaults to the previous month. | [optional] | +| **end_date** | **Time** | End date of documents to return. This defaults to the current date. | [optional] | +| **flow** | **String** | Optionally filter by document direction, where issued = `out` and received = `in` | [optional] | +| **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** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] | +| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | + +### Return type + +[**DocumentListResponse**](DocumentListResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_document_status + +> get_document_status(avalara_version, document_id, opts) + +Checks the status of a document + +Using the unique ID from POST /einvoicing/documents response body, request the current status of a document. + +### 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::DocumentsApi.new api_client + +avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +document_id = 'document_id_example' # String | The unique ID for this document that was returned in the POST /einvoicing/documents response body +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. +} + +begin + # Checks the status of a document + result = api_instance.get_document_status(avalara_version, document_id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling DocumentsApi->get_document_status: #{e}" +end +``` + +#### Using the get_document_status_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_document_status_with_http_info(avalara_version, document_id, opts) + +```ruby +begin + # Checks the status of a document + data, status_code, headers = api_instance.get_document_status_with_http_info(avalara_version, document_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling DocumentsApi->get_document_status_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 | | +| **document_id** | **String** | The unique ID for this document that was returned in the POST /einvoicing/documents response body | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | + +### Return type + +[**DocumentStatusResponse**](DocumentStatusResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## submit_document + +> submit_document(avalara_version, metadata, data, opts) + +Submits a document to Avalara E-Invoicing API + +When a UBL document is sent to this endpoint, it generates a document in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.

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

Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. + +### 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::DocumentsApi.new api_client + +avalara_version = '1.2' # 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 = { + 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. +} + +begin + # Submits a document to Avalara E-Invoicing API + result = api_instance.submit_document(avalara_version, metadata, data, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling DocumentsApi->submit_document: #{e}" +end +``` + +#### Using the submit_document_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> submit_document_with_http_info(avalara_version, metadata, data, opts) + +```ruby +begin + # Submits a document to Avalara E-Invoicing API + data, status_code, headers = api_instance.submit_document_with_http_info(avalara_version, metadata, data, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling DocumentsApi->submit_document_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 | | +| **metadata** | [**SubmitDocumentMetadata**](SubmitDocumentMetadata.md) | | | +| **data** | [**Object**](Object.md) | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | + +### Return type + +[**DocumentSubmitResponse**](DocumentSubmitResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json, text/xml + diff --git a/docs/EInvoicing/V1/ErrorResponse.md b/docs/EInvoicing/V1/ErrorResponse.md index fffc758..4320d3a 100644 --- a/docs/EInvoicing/V1/ErrorResponse.md +++ b/docs/EInvoicing/V1/ErrorResponse.md @@ -18,7 +18,7 @@ instance = AvalaraSdk::EInvoicing::V1::ErrorResponse.new( title: BadInput, status: Error, detail: The input query is invalid., - instance: unknown parameter 'city' + instance: Invalid request format or parameters. ) ``` - + diff --git a/docs/EInvoicing/V1/EventId.md b/docs/EInvoicing/V1/EventId.md new file mode 100644 index 0000000..c723d4f --- /dev/null +++ b/docs/EInvoicing/V1/EventId.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::EventId + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_name** | **String** | Unique, to the delivery system, identifier of the event. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::EventId.new( + event_name: document.complete +) +``` + diff --git a/docs/EInvoicing/V1/EventMessage.md b/docs/EInvoicing/V1/EventMessage.md new file mode 100644 index 0000000..89f0a8a --- /dev/null +++ b/docs/EInvoicing/V1/EventMessage.md @@ -0,0 +1,32 @@ +# AvalaraSdk::EInvoicing::V1::EventMessage + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **Object** | Event-specific information | | +| **signature** | [**SignatureValueSignature**](SignatureValueSignature.md) | | | +| **tenant_id** | **String** | Tenant ID of the event | | +| **correlation_id** | **String** | The correlation ID used by Avalara to aid in tracing through to provenance of this event massage. | [optional] | +| **system_code** | **String** | The Avalara registered code for the system. See <a href=\"https://avalara.atlassian.net/wiki/spaces/AIM/pages/637250338966/Taxonomy+Avalara+Systems\">Taxonomy&#58; Avalara Systems</a> | | +| **event_name** | **String** | Type of the event | | +| **event_version** | **String** | Version of the included payload. | [optional] | +| **receipt_timestamp** | **Time** | Timestamp when the event was received by the dispatch service. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::EventMessage.new( + message: null, + signature: null, + tenant_id: null, + correlation_id: null, + system_code: null, + event_name: null, + event_version: null, + receipt_timestamp: null +) +``` + diff --git a/docs/EInvoicing/V1/EventPayload.md b/docs/EInvoicing/V1/EventPayload.md new file mode 100644 index 0000000..840c0df --- /dev/null +++ b/docs/EInvoicing/V1/EventPayload.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::EventPayload + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **signature** | [**SignatureValueSignature**](SignatureValueSignature.md) | | | +| **message** | **Object** | Event-specific information | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::EventPayload.new( + signature: null, + message: null +) +``` + diff --git a/docs/EInvoicing/V1/EventSubscription.md b/docs/EInvoicing/V1/EventSubscription.md new file mode 100644 index 0000000..8721395 --- /dev/null +++ b/docs/EInvoicing/V1/EventSubscription.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::EventSubscription + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_name** | **String** | Unique, to the delivery system, identifier of the event. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::EventSubscription.new( + event_name: document.complete +) +``` + diff --git a/docs/EInvoicing/V1/FetchDocumentsRequest.md b/docs/EInvoicing/V1/FetchDocumentsRequest.md index 5f7e4d7..66a5b4e 100644 --- a/docs/EInvoicing/V1/FetchDocumentsRequest.md +++ b/docs/EInvoicing/V1/FetchDocumentsRequest.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::FetchDocumentsRequest.new( metadata: null ) ``` - + diff --git a/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md b/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md index 2b810c4..5f8aeae 100644 --- a/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md +++ b/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::FetchDocumentsRequestDataInner.new( value: null ) ``` - + diff --git a/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md b/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md index 5f6a951..2cc8c46 100644 --- a/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md +++ b/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md @@ -7,6 +7,8 @@ | **workflow_id** | **String** | Specifies a unique ID for this workflow. | | | **data_format** | **String** | Specifies the data format for this workflow | | | **data_format_version** | **Float** | Specifies the data format version number | | +| **output_data_format** | **String** | Specifies the format of the output document to be generated for the recipient. This format should be chosen based on the recipient's preferences or requirements as defined by applicable e-invoicing regulations. When not specified for mandates that don't require a specific output format, the system will use the default format defined for that mandate. | | +| **output_data_format_version** | **Float** | Specifies the version of the selected output document format | | | **country_code** | **String** | The two-letter ISO-3166 country code for the country for which document is being retrieved | | | **country_mandate** | **String** | The e-invoicing mandate for the specified country | | @@ -19,8 +21,10 @@ instance = AvalaraSdk::EInvoicing::V1::FetchDocumentsRequestMetadata.new( workflow_id: partner-einvoicing, data_format: ubl-invoice, data_format_version: 2.1, + output_data_format: ubl-invoice, + output_data_format_version: 2.1, country_code: IL, country_mandate: IL-B2B-CLEARANCE ) ``` - + diff --git a/docs/EInvoicing/V1/ForbiddenError.md b/docs/EInvoicing/V1/ForbiddenError.md index 29439cc..ba007e1 100644 --- a/docs/EInvoicing/V1/ForbiddenError.md +++ b/docs/EInvoicing/V1/ForbiddenError.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::ForbiddenError.new( message: User is not authorized to access this resource with an explicit deny ) ``` - + diff --git a/docs/EInvoicing/V1/HmacSignature.md b/docs/EInvoicing/V1/HmacSignature.md new file mode 100644 index 0000000..ab244d7 --- /dev/null +++ b/docs/EInvoicing/V1/HmacSignature.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::HmacSignature + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | HMAC key for authentication | | +| **algorithm** | **String** | HMAC algorithm for authentication | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::HmacSignature.new( + key: null, + algorithm: null +) +``` + diff --git a/docs/EInvoicing/V1/HmacSignatureValue.md b/docs/EInvoicing/V1/HmacSignatureValue.md new file mode 100644 index 0000000..1b546f3 --- /dev/null +++ b/docs/EInvoicing/V1/HmacSignatureValue.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::HmacSignatureValue + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **algorithm** | **String** | The algorithm used to create the signature. | | +| **value** | **String** | Signature of the message. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::HmacSignatureValue.new( + algorithm: sha256, + value: your-secret-key +) +``` + diff --git a/docs/EInvoicing/V1/Id.md b/docs/EInvoicing/V1/Id.md new file mode 100644 index 0000000..73a05c5 --- /dev/null +++ b/docs/EInvoicing/V1/Id.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::Id + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of this specific resource. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Id.new( + id: 0147b6a4-3b40-49d4-8762-575c903bd609 +) +``` + diff --git a/docs/EInvoicing/V1/InputDataFormats.md b/docs/EInvoicing/V1/InputDataFormats.md index 4d89e5e..f4558da 100644 --- a/docs/EInvoicing/V1/InputDataFormats.md +++ b/docs/EInvoicing/V1/InputDataFormats.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::InputDataFormats.new( versions: null ) ``` - + diff --git a/docs/EInvoicing/V1/InternalServerError.md b/docs/EInvoicing/V1/InternalServerError.md index 081c7a0..1178ee2 100644 --- a/docs/EInvoicing/V1/InternalServerError.md +++ b/docs/EInvoicing/V1/InternalServerError.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::InternalServerError.new( message: Something went wrong, please try again ) ``` - + diff --git a/docs/EInvoicing/V1/InteropApi.md b/docs/EInvoicing/V1/InteropApi.md index 7bff571..375e37e 100644 --- a/docs/EInvoicing/V1/InteropApi.md +++ b/docs/EInvoicing/V1/InteropApi.md @@ -1,95 +1,95 @@ -# AvalaraSdk::EInvoicing::V1::InteropApi - -All URIs are relative to *https://api.sbx.avalara.com/einvoicing* - -| Method | HTTP request | Description | -| ------ | ------------ | ----------- | -| [**submit_interop_document**](InteropApi.md#submit_interop_document) | **POST** /interop/documents | Submit a document | - - -## submit_interop_document - -> submit_interop_document(document_type, interchange_type, avalara_version, opts) - -Submit a document - -This API used by the interoperability partners to submit a document to their trading partners in Avalara on behalf of their customers. - -### 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::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' # 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 -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. - file_name: File.new('/path/to/some/file') # File | The file to be uploaded (e.g., UBL XML, CII XML). -} - -begin - # Submit a document - result = api_instance.submit_interop_document(document_type, interchange_type, avalara_version, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling InteropApi->submit_interop_document: #{e}" -end -``` - -#### Using the submit_interop_document_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> submit_interop_document_with_http_info(document_type, interchange_type, avalara_version, opts) - -```ruby -begin - # Submit a document - data, status_code, headers = api_instance.submit_interop_document_with_http_info(document_type, interchange_type, avalara_version, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling InteropApi->submit_interop_document_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **document_type** | **String** | Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. | | -| **interchange_type** | **String** | Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. | | -| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | -| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | -| **file_name** | **File** | The file to be uploaded (e.g., UBL XML, CII XML). | [optional] | - -### Return type - -[**SubmitInteropDocument202Response**](SubmitInteropDocument202Response.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - +# AvalaraSdk::EInvoicing::V1::InteropApi + +All URIs are relative to *https://api.sbx.avalara.com/einvoicing* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**submit_interop_document**](InteropApi.md#submit_interop_document) | **POST** /interop/documents | Submit a document | + + +## submit_interop_document + +> submit_interop_document(document_type, interchange_type, avalara_version, opts) + +Submit a document + +This API used by the interoperability partners to submit a document to their trading partners in Avalara on behalf of their customers. + +### 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::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 +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. + file_name: File.new('/path/to/some/file') # File | The file to be uploaded (e.g., UBL XML, CII XML). +} + +begin + # Submit a document + result = api_instance.submit_interop_document(document_type, interchange_type, avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling InteropApi->submit_interop_document: #{e}" +end +``` + +#### Using the submit_interop_document_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> submit_interop_document_with_http_info(document_type, interchange_type, avalara_version, opts) + +```ruby +begin + # Submit a document + data, status_code, headers = api_instance.submit_interop_document_with_http_info(document_type, interchange_type, avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling InteropApi->submit_interop_document_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **document_type** | **String** | Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. | | +| **interchange_type** | **String** | Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. | | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | +| **file_name** | **File** | The file to be uploaded (e.g., UBL XML, CII XML). | [optional] | + +### Return type + +[**SubmitInteropDocument202Response**](SubmitInteropDocument202Response.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/Mandate.md b/docs/EInvoicing/V1/Mandate.md index ef21def..53e0cab 100644 --- a/docs/EInvoicing/V1/Mandate.md +++ b/docs/EInvoicing/V1/Mandate.md @@ -8,9 +8,14 @@ | **country_mandate** | **String** | **[LEGACY]** This field is retained for backward compatibility. It is recommended to use `mandateId` instead. The `countryMandate` similar to the `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). | [optional] | | **country_code** | **String** | Country code | [optional] | | **description** | **String** | Mandate description | [optional] | -| **supported_by_partner_api** | **Boolean** | Indicates whether this mandate supported by the partner API | [optional] | +| **supported_by_elrapi** | **Boolean** | Indicates whether this mandate supported by the ELR API | [optional] | | **mandate_format** | **String** | Mandate format | [optional] | +| **e_invoicing_flow** | **String** | The type of e-invoicing flow for this mandate | [optional] | +| **e_invoicing_flow_documentation_link** | **String** | Link to the documentation for this mandate's e-invoicing flow | [optional] | +| **get_invoice_available_media_type** | **Array<String>** | List of available media types for downloading invoices for this mandate | [optional] | +| **supports_inbound_digital_document** | **String** | Indicates whether this mandate supports inbound digital documents | [optional] | | **input_data_formats** | [**Array<InputDataFormats>**](InputDataFormats.md) | Format and version used when inputting the data | [optional] | +| **output_data_formats** | [**Array<OutputDataFormats>**](OutputDataFormats.md) | Lists the supported output document formats for the country mandate. For countries where specifying an output document format is required (e.g., France), this array will contain the applicable formats. For other countries where output format selection is not necessary, the array will be empty. | [optional] | | **workflow_ids** | [**Array<WorkflowIds>**](WorkflowIds.md) | Workflow ID list | [optional] | ## Example @@ -23,10 +28,15 @@ instance = AvalaraSdk::EInvoicing::V1::Mandate.new( country_mandate: AU-B2G-PEPPOL, country_code: AU, description: The mandate supporting B2G eInvoicing in Australia. This function will create a Peppol BIS 3.0 file and sends the invoice to the related recipient via the Peppol network, - supported_by_partner_api: true, + supported_by_elrapi: true, mandate_format: xml, + e_invoicing_flow: Network, + e_invoicing_flow_documentation_link: https://documentation.example.com/flows/pt-b2c-pdf, + get_invoice_available_media_type: ["application/pdf","application/xml"], + supports_inbound_digital_document: TRUE, input_data_formats: null, + output_data_formats: null, workflow_ids: null ) ``` - + diff --git a/docs/EInvoicing/V1/MandateDataInputField.md b/docs/EInvoicing/V1/MandateDataInputField.md index 798e697..9159034 100644 --- a/docs/EInvoicing/V1/MandateDataInputField.md +++ b/docs/EInvoicing/V1/MandateDataInputField.md @@ -41,4 +41,4 @@ instance = AvalaraSdk::EInvoicing::V1::MandateDataInputField.new( cardinality: 1..1 ) ``` - + diff --git a/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md b/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md index f42e151..9a18156 100644 --- a/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md +++ b/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::MandateDataInputFieldNamespace.new( value: urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ) ``` - + diff --git a/docs/EInvoicing/V1/MandatesApi.md b/docs/EInvoicing/V1/MandatesApi.md index bbeee2c..93f82d1 100644 --- a/docs/EInvoicing/V1/MandatesApi.md +++ b/docs/EInvoicing/V1/MandatesApi.md @@ -1,183 +1,183 @@ -# AvalaraSdk::EInvoicing::V1::MandatesApi - -All URIs are relative to *https://api.sbx.avalara.com/einvoicing* - -| Method | HTTP request | Description | -| ------ | ------------ | ----------- | -| [**get_mandate_data_input_fields**](MandatesApi.md#get_mandate_data_input_fields) | **GET** /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version | -| [**get_mandates**](MandatesApi.md#get_mandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform | - - -## get_mandate_data_input_fields - -> > get_mandate_data_input_fields(avalara_version, mandate_id, document_type, document_version, opts) - -Returns document field information for a country mandate, a selected document type, and its version - -This endpoint provides document field details and the optionality of fields (required, conditional, optional) of different documents supported by the country mandate. Use the GET /mandates endpoint to retrieve all available country mandates, their supported document types and supported versions. You can use the `documentType` and `documentVersion` query parameters to retrieve the input fields for a particular document type and document version. - -### 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::MandatesApi.new api_client - -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -mandate_id = 'AD-B2G-PEPPOL' # String | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body -document_type = 'ubl-invoice' # String | Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) -document_version = '2.1' # String | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) -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. -} - -begin - # Returns document field information for a country mandate, a selected document type, and its version - result = api_instance.get_mandate_data_input_fields(avalara_version, mandate_id, document_type, document_version, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling MandatesApi->get_mandate_data_input_fields: #{e}" -end -``` - -#### Using the get_mandate_data_input_fields_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> >, Integer, Hash)> get_mandate_data_input_fields_with_http_info(avalara_version, mandate_id, document_type, document_version, opts) - -```ruby -begin - # Returns document field information for a country mandate, a selected document type, and its version - data, status_code, headers = api_instance.get_mandate_data_input_fields_with_http_info(avalara_version, mandate_id, document_type, document_version, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => > -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling MandatesApi->get_mandate_data_input_fields_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 | | -| **mandate_id** | **String** | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body | | -| **document_type** | **String** | Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) | | -| **document_version** | **String** | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | - -### Return type - -[**Array<MandateDataInputField>**](MandateDataInputField.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_mandates - -> get_mandates(avalara_version, opts) - -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. - -### 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::MandatesApi.new api_client - -avalara_version = '1.2' # 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: 10, # Float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. - skip: 10, # Float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. - 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 -} - -begin - # List country mandates that are supported by the Avalara E-Invoicing platform - result = api_instance.get_mandates(avalara_version, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling MandatesApi->get_mandates: #{e}" -end -``` - -#### Using the get_mandates_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_mandates_with_http_info(avalara_version, opts) - -```ruby -begin - # List country mandates that are supported by the Avalara E-Invoicing platform - data, status_code, headers = api_instance.get_mandates_with_http_info(avalara_version, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling MandatesApi->get_mandates_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 | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | -| **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] | -| **top** | **Float** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] | -| **skip** | **Float** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | -| **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] | - -### Return type - -[**MandatesResponse**](MandatesResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - +# AvalaraSdk::EInvoicing::V1::MandatesApi + +All URIs are relative to *https://api.sbx.avalara.com/einvoicing* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_mandate_data_input_fields**](MandatesApi.md#get_mandate_data_input_fields) | **GET** /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version | +| [**get_mandates**](MandatesApi.md#get_mandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform | + + +## get_mandate_data_input_fields + +> > get_mandate_data_input_fields(avalara_version, mandate_id, document_type, document_version, opts) + +Returns document field information for a country mandate, a selected document type, and its version + +This endpoint provides document field details and the optionality of fields (required, conditional, optional) of different documents supported by the country mandate. Use the GET /mandates endpoint to retrieve all available country mandates, their supported document types and supported versions. You can use the `documentType` and `documentVersion` query parameters to retrieve the input fields for a particular document type and document version. + +### 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::MandatesApi.new api_client + +avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +mandate_id = 'AD-B2G-PEPPOL' # String | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body +document_type = 'ubl-invoice' # String | Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) +document_version = '2.1' # String | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) +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. +} + +begin + # Returns document field information for a country mandate, a selected document type, and its version + result = api_instance.get_mandate_data_input_fields(avalara_version, mandate_id, document_type, document_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling MandatesApi->get_mandate_data_input_fields: #{e}" +end +``` + +#### Using the get_mandate_data_input_fields_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_mandate_data_input_fields_with_http_info(avalara_version, mandate_id, document_type, document_version, opts) + +```ruby +begin + # Returns document field information for a country mandate, a selected document type, and its version + data, status_code, headers = api_instance.get_mandate_data_input_fields_with_http_info(avalara_version, mandate_id, document_type, document_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling MandatesApi->get_mandate_data_input_fields_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 | | +| **mandate_id** | **String** | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body | | +| **document_type** | **String** | Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) | | +| **document_version** | **String** | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | + +### Return type + +[**Array<MandateDataInputField>**](MandateDataInputField.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_mandates + +> get_mandates(avalara_version, opts) + +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. + +### 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::MandatesApi.new api_client + +avalara_version = '1.2' # 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: 10, # Float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. + skip: 10, # Float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + 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 +} + +begin + # List country mandates that are supported by the Avalara E-Invoicing platform + result = api_instance.get_mandates(avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling MandatesApi->get_mandates: #{e}" +end +``` + +#### Using the get_mandates_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_mandates_with_http_info(avalara_version, opts) + +```ruby +begin + # List country mandates that are supported by the Avalara E-Invoicing platform + data, status_code, headers = api_instance.get_mandates_with_http_info(avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling MandatesApi->get_mandates_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 | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | +| **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] | +| **top** | **Float** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] | +| **skip** | **Float** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **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] | + +### Return type + +[**MandatesResponse**](MandatesResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/MandatesResponse.md b/docs/EInvoicing/V1/MandatesResponse.md index 47606f4..27613d5 100644 --- a/docs/EInvoicing/V1/MandatesResponse.md +++ b/docs/EInvoicing/V1/MandatesResponse.md @@ -19,4 +19,4 @@ instance = AvalaraSdk::EInvoicing::V1::MandatesResponse.new( value: null ) ``` - + diff --git a/docs/EInvoicing/V1/NotFoundError.md b/docs/EInvoicing/V1/NotFoundError.md index 9bbf3ca..abd06d8 100644 --- a/docs/EInvoicing/V1/NotFoundError.md +++ b/docs/EInvoicing/V1/NotFoundError.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::NotFoundError.new( message: Not Found ) ``` - + diff --git a/docs/EInvoicing/V1/NotUsedForField.md b/docs/EInvoicing/V1/NotUsedForField.md index 32a75df..eb44a94 100644 --- a/docs/EInvoicing/V1/NotUsedForField.md +++ b/docs/EInvoicing/V1/NotUsedForField.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::NotUsedForField.new( country_mandate: null ) ``` - + diff --git a/docs/EInvoicing/V1/OutputDataFormats.md b/docs/EInvoicing/V1/OutputDataFormats.md new file mode 100644 index 0000000..3183fa1 --- /dev/null +++ b/docs/EInvoicing/V1/OutputDataFormats.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::OutputDataFormats + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **format** | **String** | Document format | [optional] | +| **versions** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::OutputDataFormats.new( + format: ubl-invoice, + versions: null +) +``` + diff --git a/docs/EInvoicing/V1/Pagination.md b/docs/EInvoicing/V1/Pagination.md new file mode 100644 index 0000000..966b1da --- /dev/null +++ b/docs/EInvoicing/V1/Pagination.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::Pagination + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recordset_count** | **Integer** | The total count of records in the dataset. | [optional] | +| **next_link** | **String** | The URL to the next page of results. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Pagination.new( + recordset_count: null, + next_link: null +) +``` + diff --git a/docs/EInvoicing/V1/RequiredWhenField.md b/docs/EInvoicing/V1/RequiredWhenField.md index 7724a7a..e443564 100644 --- a/docs/EInvoicing/V1/RequiredWhenField.md +++ b/docs/EInvoicing/V1/RequiredWhenField.md @@ -15,4 +15,4 @@ instance = AvalaraSdk::EInvoicing::V1::RequiredWhenField.new( scenario: ) ``` - + diff --git a/docs/EInvoicing/V1/Signature.md b/docs/EInvoicing/V1/Signature.md new file mode 100644 index 0000000..fa118fc --- /dev/null +++ b/docs/EInvoicing/V1/Signature.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::Signature + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **signature** | [**SignatureSignature**](SignatureSignature.md) | | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Signature.new( + signature: null +) +``` + diff --git a/docs/EInvoicing/V1/SignatureSignature.md b/docs/EInvoicing/V1/SignatureSignature.md new file mode 100644 index 0000000..86bdf89 --- /dev/null +++ b/docs/EInvoicing/V1/SignatureSignature.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::SignatureSignature + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | | +| **key** | **String** | HMAC key for authentication | | +| **algorithm** | **String** | HMAC algorithm for authentication | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SignatureSignature.new( + type: none, + key: null, + algorithm: null +) +``` + diff --git a/docs/EInvoicing/V1/SignatureValue.md b/docs/EInvoicing/V1/SignatureValue.md new file mode 100644 index 0000000..5592fe3 --- /dev/null +++ b/docs/EInvoicing/V1/SignatureValue.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::SignatureValue + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **signature** | [**SignatureValueSignature**](SignatureValueSignature.md) | | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SignatureValue.new( + signature: null +) +``` + diff --git a/docs/EInvoicing/V1/SignatureValueSignature.md b/docs/EInvoicing/V1/SignatureValueSignature.md new file mode 100644 index 0000000..e51a945 --- /dev/null +++ b/docs/EInvoicing/V1/SignatureValueSignature.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::SignatureValueSignature + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | | +| **algorithm** | **String** | The algorithm used to create the signature. | | +| **value** | **String** | Signature of the message. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SignatureValueSignature.new( + type: null, + algorithm: sha256, + value: your-secret-key +) +``` + diff --git a/docs/EInvoicing/V1/StatusEvent.md b/docs/EInvoicing/V1/StatusEvent.md index e2ab2f4..ae5527a 100644 --- a/docs/EInvoicing/V1/StatusEvent.md +++ b/docs/EInvoicing/V1/StatusEvent.md @@ -21,4 +21,4 @@ instance = AvalaraSdk::EInvoicing::V1::StatusEvent.new( response_value: 2865701 ) ``` - + diff --git a/docs/EInvoicing/V1/SubmitDocumentMetadata.md b/docs/EInvoicing/V1/SubmitDocumentMetadata.md index 3866ec3..175510b 100644 --- a/docs/EInvoicing/V1/SubmitDocumentMetadata.md +++ b/docs/EInvoicing/V1/SubmitDocumentMetadata.md @@ -7,6 +7,8 @@ | **workflow_id** | **String** | Specifies a unique ID for this workflow. | | | **data_format** | **String** | Specifies the data format for this workflow. | | | **data_format_version** | **String** | Specifies the data format version number. | | +| **output_data_format** | **String** | Specifies the format of the output document to be generated for the recipient. This format should be chosen based on the recipient's preferences or requirements as defined by applicable e-invoicing regulations. When not specified for mandates that don't require a specific output format, the system will use the default format defined for that mandate. | [optional] | +| **output_data_format_version** | **String** | Specifies the version of the selected output document format | [optional] | | **country_code** | **String** | The two-letter ISO-3166 country code for the country where the document is being submitted | | | **country_mandate** | **String** | The e-invoicing mandate for the specified country. | | @@ -19,8 +21,10 @@ instance = AvalaraSdk::EInvoicing::V1::SubmitDocumentMetadata.new( workflow_id: partner-einvoicing, data_format: ubl-invoice, data_format_version: 2.1, + output_data_format: ubl-invoice, + output_data_format_version: 2.1, country_code: SA, country_mandate: SA-Phase1-B2B ) ``` - + diff --git a/docs/EInvoicing/V1/SubmitInteropDocument202Response.md b/docs/EInvoicing/V1/SubmitInteropDocument202Response.md index 2b2f998..66ddcc7 100644 --- a/docs/EInvoicing/V1/SubmitInteropDocument202Response.md +++ b/docs/EInvoicing/V1/SubmitInteropDocument202Response.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::SubmitInteropDocument202Response.new( message: Document accepted for processing. ) ``` - + diff --git a/docs/EInvoicing/V1/SubscriptionCommon.md b/docs/EInvoicing/V1/SubscriptionCommon.md new file mode 100644 index 0000000..dfda888 --- /dev/null +++ b/docs/EInvoicing/V1/SubscriptionCommon.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::SubscriptionCommon + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **description** | **String** | Description of the subscription | [optional] | +| **notification_url** | **String** | The URL of the webhook endpoint to which event messages will be delivered | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SubscriptionCommon.new( + description: Basic webhook configuration without signature, + notification_url: https://webhook.example.com/notifications +) +``` + diff --git a/docs/EInvoicing/V1/SubscriptionDetail.md b/docs/EInvoicing/V1/SubscriptionDetail.md new file mode 100644 index 0000000..c31456a --- /dev/null +++ b/docs/EInvoicing/V1/SubscriptionDetail.md @@ -0,0 +1,26 @@ +# AvalaraSdk::EInvoicing::V1::SubscriptionDetail + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of this specific resource. | | +| **description** | **String** | Description of the subscription | [optional] | +| **notification_url** | **String** | The URL of the webhook endpoint to which event messages will be delivered | | +| **signature** | [**SignatureSignature**](SignatureSignature.md) | | | +| **events** | [**Array<EventSubscription>**](EventSubscription.md) | | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SubscriptionDetail.new( + id: 0147b6a4-3b40-49d4-8762-575c903bd609, + description: Basic webhook configuration without signature, + notification_url: https://webhook.example.com/notifications, + signature: null, + events: null +) +``` + diff --git a/docs/EInvoicing/V1/SubscriptionListResponse.md b/docs/EInvoicing/V1/SubscriptionListResponse.md new file mode 100644 index 0000000..b7469f6 --- /dev/null +++ b/docs/EInvoicing/V1/SubscriptionListResponse.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::SubscriptionListResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recordset_count** | **Integer** | The total count of records in the dataset. | [optional] | +| **next_link** | **String** | The URL to the next page of results. | [optional] | +| **value** | [**Array<SubscriptionDetail>**](SubscriptionDetail.md) | The list of subscriptions. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SubscriptionListResponse.new( + recordset_count: null, + next_link: null, + value: null +) +``` + diff --git a/docs/EInvoicing/V1/SubscriptionRegistration.md b/docs/EInvoicing/V1/SubscriptionRegistration.md new file mode 100644 index 0000000..560542b --- /dev/null +++ b/docs/EInvoicing/V1/SubscriptionRegistration.md @@ -0,0 +1,24 @@ +# AvalaraSdk::EInvoicing::V1::SubscriptionRegistration + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **description** | **String** | Description of the subscription | [optional] | +| **notification_url** | **String** | The URL of the webhook endpoint to which event messages will be delivered | | +| **signature** | [**SignatureSignature**](SignatureSignature.md) | | | +| **events** | [**Array<EventSubscription>**](EventSubscription.md) | | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SubscriptionRegistration.new( + description: Basic webhook configuration without signature, + notification_url: https://webhook.example.com/notifications, + signature: null, + events: null +) +``` + diff --git a/docs/EInvoicing/V1/SubscriptionsApi.md b/docs/EInvoicing/V1/SubscriptionsApi.md new file mode 100644 index 0000000..3191e70 --- /dev/null +++ b/docs/EInvoicing/V1/SubscriptionsApi.md @@ -0,0 +1,348 @@ +# AvalaraSdk::EInvoicing::V1::SubscriptionsApi + +All URIs are relative to *https://api.sbx.avalara.com/einvoicing* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_webhook_subscription**](SubscriptionsApi.md#create_webhook_subscription) | **POST** /webhooks/subscriptions | Create a subscription to events | +| [**delete_webhook_subscription**](SubscriptionsApi.md#delete_webhook_subscription) | **DELETE** /webhooks/subscriptions/{subscription-id} | Unsubscribe from events | +| [**get_webhook_subscription**](SubscriptionsApi.md#get_webhook_subscription) | **GET** /webhooks/subscriptions/{subscription-id} | Get details of a subscription | +| [**list_webhook_subscriptions**](SubscriptionsApi.md#list_webhook_subscriptions) | **GET** /webhooks/subscriptions | List all subscriptions | + + +## create_webhook_subscription + +> create_webhook_subscription(avalara_version, subscription_registration, opts) + +Create a subscription to events + +Create a subscription to events exposed by registered systems. + +### 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::SubscriptionsApi.new api_client + +avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.3\". +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 + x_avalara_client: 'x_avalara_client_example' # String | Client application identification +} + +begin + # Create a subscription to events + result = api_instance.create_webhook_subscription(avalara_version, subscription_registration, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling SubscriptionsApi->create_webhook_subscription: #{e}" +end +``` + +#### Using the create_webhook_subscription_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_webhook_subscription_with_http_info(avalara_version, subscription_registration, opts) + +```ruby +begin + # Create a subscription to events + data, status_code, headers = api_instance.create_webhook_subscription_with_http_info(avalara_version, subscription_registration, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling SubscriptionsApi->create_webhook_subscription_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **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] | + +### Return type + +[**SuccessResponse**](SuccessResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_webhook_subscription + +> delete_webhook_subscription(subscription_id, avalara_version, opts) + +Unsubscribe from events + +Remove a subscription from the webhooks dispatch service. All events and subscriptions are also deleted. + +### 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::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\". +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 +} + +begin + # Unsubscribe from events + api_instance.delete_webhook_subscription(subscription_id, avalara_version, opts) +rescue AvalaraSdk::ApiError => e + puts "Error when calling SubscriptionsApi->delete_webhook_subscription: #{e}" +end +``` + +#### Using the delete_webhook_subscription_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_webhook_subscription_with_http_info(subscription_id, avalara_version, opts) + +```ruby +begin + # Unsubscribe from events + data, status_code, headers = api_instance.delete_webhook_subscription_with_http_info(subscription_id, avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling SubscriptionsApi->delete_webhook_subscription_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subscription_id** | **String** | | | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | +| **x_avalara_client** | **String** | Client application identification | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_webhook_subscription + +> get_webhook_subscription(subscription_id, avalara_version, opts) + +Get details of a subscription + +Retrieve details of a specific subscription. + +### 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::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\". +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 +} + +begin + # Get details of a subscription + result = api_instance.get_webhook_subscription(subscription_id, avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling SubscriptionsApi->get_webhook_subscription: #{e}" +end +``` + +#### Using the get_webhook_subscription_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_webhook_subscription_with_http_info(subscription_id, avalara_version, opts) + +```ruby +begin + # Get details of a subscription + data, status_code, headers = api_instance.get_webhook_subscription_with_http_info(subscription_id, avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling SubscriptionsApi->get_webhook_subscription_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subscription_id** | **String** | | | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | +| **x_avalara_client** | **String** | Client application identification | [optional] | + +### Return type + +[**SubscriptionDetail**](SubscriptionDetail.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_webhook_subscriptions + +> list_webhook_subscriptions(avalara_version, opts) + +List all subscriptions + +Retrieve a list of all subscriptions. + +### 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::SubscriptionsApi.new api_client + +avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.3\". +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: 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. +} + +begin + # List all subscriptions + result = api_instance.list_webhook_subscriptions(avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling SubscriptionsApi->list_webhook_subscriptions: #{e}" +end +``` + +#### Using the list_webhook_subscriptions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_webhook_subscriptions_with_http_info(avalara_version, opts) + +```ruby +begin + # List all subscriptions + data, status_code, headers = api_instance.list_webhook_subscriptions_with_http_info(avalara_version, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling SubscriptionsApi->list_webhook_subscriptions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | +| **x_avalara_client** | **String** | Client application identification | [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] | + +### Return type + +[**SubscriptionListResponse**](SubscriptionListResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/SuccessResponse.md b/docs/EInvoicing/V1/SuccessResponse.md new file mode 100644 index 0000000..ec77501 --- /dev/null +++ b/docs/EInvoicing/V1/SuccessResponse.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::SuccessResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier for the new or updated entity. | [optional] | +| **message** | **String** | Success message | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SuccessResponse.new( + id: 78f6caaa-6988-4862-bd11-e52906b31b72, + message: Webhook subscription created successfully +) +``` + diff --git a/docs/EInvoicing/V1/TradingPartnersApi.md b/docs/EInvoicing/V1/TradingPartnersApi.md index d3d8c74..1ca9e3d 100644 --- a/docs/EInvoicing/V1/TradingPartnersApi.md +++ b/docs/EInvoicing/V1/TradingPartnersApi.md @@ -1,448 +1,449 @@ -# AvalaraSdk::EInvoicing::V1::TradingPartnersApi - -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. | -| [**search_participants**](TradingPartnersApi.md#search_participants) | **GET** /trading-partners | Returns a list of participants matching the input query. | - - -## 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. - -### 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.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. -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 search and performs a batch search in the directory for participants in the background. - api_instance.batch_search_participants(avalara_version, name, notification_email, file, opts) -rescue AvalaraSdk::ApiError => e - puts "Error when calling TradingPartnersApi->batch_search_participants: #{e}" -end -``` - -#### Using the batch_search_participants_with_http_info variant - -This returns an Array which contains the response data (`nil` in this case), status code and headers. - -> batch_search_participants_with_http_info(avalara_version, name, notification_email, file, opts) - -```ruby -begin - # Creates a batch search and performs a batch search in the directory for participants in the background. - 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 # => { ... } - p data # => nil -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling TradingPartnersApi->batch_search_participants_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 | | -| **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] | -| **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**: multipart/form-data -- **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 the report for a specific batch search using the batch search 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.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. -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 - # Download batch search results in a csv file. - result = api_instance.download_batch_search_report(avalara_version, id, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling TradingPartnersApi->download_batch_search_report: #{e}" -end -``` - -#### Using the download_batch_search_report_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> download_batch_search_report_with_http_info(avalara_version, id, opts) - -```ruby -begin - # Download 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 # => { ... } - p data # => File -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling TradingPartnersApi->download_batch_search_report_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 batch search whose report is to be downloaded. | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | -| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | - -### Return type - -**File** - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/csv, application/json - - -## get_batch_search_detail - -> get_batch_search_detail(avalara_version, id, opts) - -Get the batch search details for a given id. - -Get the batch search details for a given 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.2' # String | The HTTP Header meant to specify the version of the API intended to be used -id = '2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99' # String | The ID of the batch search that was submitted earlier. -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 - # Get the batch search details for a given id. - result = api_instance.get_batch_search_detail(avalara_version, id, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling TradingPartnersApi->get_batch_search_detail: #{e}" -end -``` - -#### Using the get_batch_search_detail_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_batch_search_detail_with_http_info(avalara_version, id, opts) - -```ruby -begin - # Get the batch search details for a given id. - data, status_code, headers = api_instance.get_batch_search_detail_with_http_info(avalara_version, id, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling TradingPartnersApi->get_batch_search_detail_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 batch search that was submitted earlier. | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | -| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | - -### Return type - -[**BatchSearch**](BatchSearch.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## list_batch_searches - -> list_batch_searches(avalara_version, opts) - -List all batch searches that were previously submitted. - -Retrieves all batch searches performed by the user. - -### 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.2' # 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: '10', # String | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. - skip: '10', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. - order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. - x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. -} - -begin - # List all batch searches that were previously submitted. - result = api_instance.list_batch_searches(avalara_version, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling TradingPartnersApi->list_batch_searches: #{e}" -end -``` - -#### Using the list_batch_searches_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> list_batch_searches_with_http_info(avalara_version, opts) - -```ruby -begin - # List 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 # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling TradingPartnersApi->list_batch_searches_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 | | -| **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** | **String** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | -| **order_by** | **String** | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | -| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | - -### Return type - -[**BatchSearchListResponse**](BatchSearchListResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## search_participants - -> search_participants(avalara_version, search, opts) - -Returns a list of participants matching the input query. - -Returns a list of participants matching the input query. - -### 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.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. -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: '10', # String | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. - skip: '10', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. - order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. - x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. -} - -begin - # Returns a list of participants matching the input query. - result = api_instance.search_participants(avalara_version, search, opts) - p result -rescue AvalaraSdk::ApiError => e - puts "Error when calling TradingPartnersApi->search_participants: #{e}" -end -``` - -#### Using the search_participants_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> search_participants_with_http_info(avalara_version, search, opts) - -```ruby -begin - # Returns a list of participants matching the input query. - data, status_code, headers = api_instance.search_participants_with_http_info(avalara_version, search, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue AvalaraSdk::EInvoicing::V1::ApiError => e - puts "Error when calling TradingPartnersApi->search_participants_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 | | -| **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** | **String** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | -| **order_by** | **String** | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | -| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | - -### Return type - -[**DirectorySearchResponse**](DirectorySearchResponse.md) - -### Authorization - -[Bearer](../../../README.md#documentation-for-authorization) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - +# AvalaraSdk::EInvoicing::V1::TradingPartnersApi + +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. | +| [**search_participants**](TradingPartnersApi.md#search_participants) | **GET** /trading-partners | Returns a list of participants matching the input query. | + + +## 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. + +### 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.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. +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 search and performs a batch search in the directory for participants in the background. + result = api_instance.batch_search_participants(avalara_version, name, notification_email, file, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->batch_search_participants: #{e}" +end +``` + +#### Using the batch_search_participants_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> batch_search_participants_with_http_info(avalara_version, name, notification_email, file, opts) + +```ruby +begin + # Creates a batch search and performs a batch search in the directory for participants in the background. + 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 # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->batch_search_participants_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 | | +| **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] | +| **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 + +[**BatchSearchParticipants202Response**](BatchSearchParticipants202Response.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **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 the report for a specific batch search using the batch search 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.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. +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 + # Download batch search results in a csv file. + result = api_instance.download_batch_search_report(avalara_version, id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->download_batch_search_report: #{e}" +end +``` + +#### Using the download_batch_search_report_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> download_batch_search_report_with_http_info(avalara_version, id, opts) + +```ruby +begin + # Download 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 # => { ... } + p data # => File +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->download_batch_search_report_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 batch search whose report is to be downloaded. | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +**File** + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/csv, application/json + + +## get_batch_search_detail + +> get_batch_search_detail(avalara_version, id, opts) + +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. + +### 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.2' # String | The HTTP Header meant to specify the version of the API intended to be used +id = '2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99' # String | The ID of the batch search that was submitted earlier. +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 + # Get the batch search details for a given id. + result = api_instance.get_batch_search_detail(avalara_version, id, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->get_batch_search_detail: #{e}" +end +``` + +#### Using the get_batch_search_detail_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_batch_search_detail_with_http_info(avalara_version, id, opts) + +```ruby +begin + # Get the batch search details for a given id. + data, status_code, headers = api_instance.get_batch_search_detail_with_http_info(avalara_version, id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->get_batch_search_detail_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 batch search that was submitted earlier. | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**BatchSearch**](BatchSearch.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_batch_searches + +> list_batch_searches(avalara_version, opts) + +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. + +### 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.2' # 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: '10', # String | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. + skip: '10', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # List all batch searches that were previously submitted. + result = api_instance.list_batch_searches(avalara_version, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->list_batch_searches: #{e}" +end +``` + +#### Using the list_batch_searches_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_batch_searches_with_http_info(avalara_version, opts) + +```ruby +begin + # List 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 # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->list_batch_searches_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 | | +| **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** | **String** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] | +| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **order_by** | **String** | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**BatchSearchListResponse**](BatchSearchListResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## search_participants + +> 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. + +### 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.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. +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: '10', # String | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. + skip: '10', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # Returns a list of participants matching the input query. + result = api_instance.search_participants(avalara_version, search, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->search_participants: #{e}" +end +``` + +#### Using the search_participants_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> search_participants_with_http_info(avalara_version, search, opts) + +```ruby +begin + # Returns a list of participants matching the input query. + data, status_code, headers = api_instance.search_participants_with_http_info(avalara_version, search, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->search_participants_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 | | +| **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** | **String** | If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] | +| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **order_by** | **String** | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**DirectorySearchResponse**](DirectorySearchResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/WebhookInvocation.md b/docs/EInvoicing/V1/WebhookInvocation.md new file mode 100644 index 0000000..0e0b882 --- /dev/null +++ b/docs/EInvoicing/V1/WebhookInvocation.md @@ -0,0 +1,28 @@ +# AvalaraSdk::EInvoicing::V1::WebhookInvocation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of this specific resource. | | +| **retry_count** | **Integer** | The number of invocation attempts. | [optional] | +| **retry_max** | **Integer** | The maximum retries that may be attempted in total. | [optional] | +| **invocation_timestamp** | **Time** | Initial timestamp of the first invocation attempt. | | +| **retry_timestamp** | **Time** | Timestamp of this invocation attempt. | [optional] | +| **items** | [**Array<EventMessage>**](EventMessage.md) | Array of events being delivered in the webhook | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::WebhookInvocation.new( + id: 0147b6a4-3b40-49d4-8762-575c903bd609, + retry_count: null, + retry_max: null, + invocation_timestamp: null, + retry_timestamp: null, + items: null +) +``` + diff --git a/docs/EInvoicing/V1/WebhooksErrorInfo.md b/docs/EInvoicing/V1/WebhooksErrorInfo.md new file mode 100644 index 0000000..bc8f17f --- /dev/null +++ b/docs/EInvoicing/V1/WebhooksErrorInfo.md @@ -0,0 +1,24 @@ +# AvalaraSdk::EInvoicing::V1::WebhooksErrorInfo + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | An identifying name for the error. | [optional] | +| **status** | **String** | A conanoical error status. | [optional] | +| **detail** | **String** | A detailed description of the error type. | [optional] | +| **instance** | **String** | A detailed description of the specific error ocurrance. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::WebhooksErrorInfo.new( + title: CustomException, + status: Error, + detail: Customized error detail message., + instance: more details +) +``` + diff --git a/docs/EInvoicing/V1/WebhooksErrorResponse.md b/docs/EInvoicing/V1/WebhooksErrorResponse.md new file mode 100644 index 0000000..ceea0a7 --- /dev/null +++ b/docs/EInvoicing/V1/WebhooksErrorResponse.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::WebhooksErrorResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **error** | [**WebhooksErrorInfo**](WebhooksErrorInfo.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::WebhooksErrorResponse.new( + error: null +) +``` + diff --git a/docs/EInvoicing/V1/WorkflowIds.md b/docs/EInvoicing/V1/WorkflowIds.md index 6078556..fe08f6f 100644 --- a/docs/EInvoicing/V1/WorkflowIds.md +++ b/docs/EInvoicing/V1/WorkflowIds.md @@ -17,4 +17,4 @@ instance = AvalaraSdk::EInvoicing::V1::WorkflowIds.new( description: The standard value for the metadata object in POST /einvoicing/documents ) ``` - + diff --git a/lib/avalara_sdk.rb b/lib/avalara_sdk.rb index a6838f7..b074258 100644 --- a/lib/avalara_sdk.rb +++ b/lib/avalara_sdk.rb @@ -1,24 +1,103 @@ -=begin - -This is auto-generated class by sdk-generator - -=end - -# All files +=begin + +This is auto-generated class by sdk-generator + +=end + +# All files require File.expand_path( '../avalara_sdk/api_client.rb', __FILE__) require File.expand_path( '../avalara_sdk/api_error.rb', __FILE__) +require File.expand_path( '../avalara_sdk/api/A1099/V2/companies_w9_api.rb', __FILE__) +require File.expand_path( '../avalara_sdk/api/A1099/V2/forms_w9_api.rb', __FILE__) +require File.expand_path( '../avalara_sdk/api/A1099/V2/forms1099_api.rb', __FILE__) +require File.expand_path( '../avalara_sdk/api/A1099/V2/issuers1099_api.rb', __FILE__) +require File.expand_path( '../avalara_sdk/api/A1099/V2/jobs1099_api.rb', __FILE__) require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb', __FILE__) require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/documents_api.rb', __FILE__) 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/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__) require File.expand_path( '../avalara_sdk/auth/token_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/configuration.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/attribute.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/authorized_api_request_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/base_company_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/base_form_list_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/company_create_update_request_model.rb', __FILE__) +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/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_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/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_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.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.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.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.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.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/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__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/job_result.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/link.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb', __FILE__) +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/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.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/substantial_us_owner_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_response.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_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_response.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_response.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_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/data_input_field_not_used_for.rb', __FILE__) @@ -41,10 +120,17 @@ require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/document_submit_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/document_summary.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/error_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/event_id.rb', __FILE__) +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/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__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/forbidden_error.rb', __FILE__) +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/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__) @@ -53,31 +139,45 @@ require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/mandates_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/not_found_error.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/not_used_for_field.rb', __FILE__) +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/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__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/signature.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/status_event.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/submit_document_data.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/submit_document_metadata.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/submit_interop_document202_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/subscription_common.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/subscription_detail.rb', __FILE__) +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/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__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/workflow_ids.rb', __FILE__) require File.expand_path( '../avalara_sdk/response_hash.rb', __FILE__) require File.expand_path( '../avalara_sdk/token_metadata.rb', __FILE__) -require File.expand_path( '../avalara_sdk/version.rb', __FILE__) - - -module AvalaraSdk - class << self - # Customize default settings for the SDK using block. - # AvalaraSdk.configure do |config| - # config.username = "xxx" - # config.password = "xxx" - # end - # If no block given, return the default Configuration object. - def configure - if block_given? - yield(Configuration.default) - else - Configuration.default - end - end - end -end +require File.expand_path( '../avalara_sdk/version.rb', __FILE__) + + +module AvalaraSdk + class << self + # Customize default settings for the SDK using block. + # AvalaraSdk.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb b/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb new file mode 100644 index 0000000..dc090e8 --- /dev/null +++ b/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb @@ -0,0 +1,952 @@ +=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) + + +=end + +require 'cgi' + +module AvalaraSdk::A1099 + module AvalaraSdk::A1099::V2 + class CompaniesW9Api + 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.6.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::A1099::V2.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 + + # Creates a new company + # Creates a new company + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param company_create_update_request_model [CompanyCreateUpdateRequestModel] The company to create + # @return [CompanyResponseModel] + def create_company(request_parameters) + data, _status_code, _headers = create_company_with_http_info(request_parameters) + data + end + + # Creates a new company + # Creates a new company + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @param company_create_update_request_model [CompanyCreateUpdateRequestModel] The company to create + # @return [Array<(CompanyResponseModel, Integer, Hash)>] CompanyResponseModel data, response status code and response headers + def create_company_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + company_create_update_request_model = request_parameters.get_company_create_update_request_model() + # 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 CompaniesW9Api.create_company" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling CompaniesW9Api.create_company" + end + # resource path + local_var_path = '/w9/companies' + + # 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', 'text/json', '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_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(company_create_update_request_model) || {} + + # return_type + return_type = 'CompanyResponseModel' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"CompaniesW9Api.create_company", + :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, :A1099) + 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 company + # Deletes 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 + # @return [nil] + def delete_company(request_parameters) + delete_company_with_http_info(request_parameters) + nil + end + + # Deletes a company + # Deletes 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 + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_company_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 CompaniesW9Api.delete_company" + end + # 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 CompaniesW9Api.delete_company" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling CompaniesW9Api.delete_company" + end + # resource path + local_var_path = '/w9/companies/{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_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 => :"CompaniesW9Api.delete_company", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # List companies + # List existing companies. Filterable/Sortable fields are: \"name\", \"referenceId\", \"group.name\", \"createdAt\" and \"updatedAt\". + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @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. + # @return [PaginatedQueryResultModelCompanyResponse] + def get_companies(request_parameters) + data, _status_code, _headers = get_companies_with_http_info(request_parameters) + data + end + + # List companies + # List existing companies. Filterable/Sortable fields are: \"name\", \"referenceId\", \"group.name\", \"createdAt\" and \"updatedAt\". + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @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. + # @return [Array<(PaginatedQueryResultModelCompanyResponse, Integer, Hash)>] PaginatedQueryResultModelCompanyResponse data, response status code and response headers + def get_companies_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + filter = request_parameters.get_filter() + top = request_parameters.get_top() + skip = request_parameters.get_skip() + order_by = request_parameters.get_order_by() + count = request_parameters.get_count() + count_only = request_parameters.get_count_only() + # 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 CompaniesW9Api.get_companies" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling CompaniesW9Api.get_companies" + end + # resource path + local_var_path = '/w9/companies' + + # query parameters + query_params = {} + if !filter.nil? + query_params[:'$filter'] = filter + end + if !top.nil? + query_params[:'$top'] = top + end + if !skip.nil? + query_params[:'$skip'] = skip + end + if !order_by.nil? + query_params[:'$orderBy'] = order_by + end + if !count.nil? + query_params[:'count'] = count + end + if !count_only.nil? + query_params[:'countOnly'] = count_only + 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_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 = 'PaginatedQueryResultModelCompanyResponse' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"CompaniesW9Api.get_companies", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Retrieve a company + # Retrieve an existing 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 + # @return [CompanyResponse] + def get_company(request_parameters) + data, _status_code, _headers = get_company_with_http_info(request_parameters) + data + end + + # Retrieve a company + # Retrieve an existing 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 + # @return [Array<(CompanyResponse, Integer, Hash)>] CompanyResponse data, response status code and response headers + def get_company_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 CompaniesW9Api.get_company" + end + # 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 CompaniesW9Api.get_company" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling CompaniesW9Api.get_company" + end + # resource path + local_var_path = '/w9/companies/{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_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 = 'CompanyResponse' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"CompaniesW9Api.get_company", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # 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 company_create_update_request_model [CompanyCreateUpdateRequestModel] The updated company data + # @return [CompanyResponseModel] + def update_company(request_parameters) + data, _status_code, _headers = update_company_with_http_info(request_parameters) + data + end + + # 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 company_create_update_request_model [CompanyCreateUpdateRequestModel] The updated company data + # @return [Array<(CompanyResponseModel, Integer, Hash)>] CompanyResponseModel data, response status code and response headers + def update_company_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + company_create_update_request_model = request_parameters.get_company_create_update_request_model() + # 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 CompaniesW9Api.update_company" + end + # 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 CompaniesW9Api.update_company" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling CompaniesW9Api.update_company" + end + # resource path + local_var_path = '/w9/companies/{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', 'text/json', '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_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(company_create_update_request_model) || {} + + # return_type + return_type = 'CompanyResponseModel' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"CompaniesW9Api.update_company", + :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, :A1099) + 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 CreateCompany API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param CompanyCreateUpdateRequestModel $company_create_update_request_model The company to create (optional) + # + class CreateCompanyRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :company_create_update_request_model + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_company_create_update_request_model() + return @company_create_update_request_model + end + + def set_company_create_update_request_model(company_create_update_request_model) + @company_create_update_request_model = company_create_update_request_model + end + end + # Represents the Request object for the DeleteCompany API + # + # @param String $id The company to delete (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class DeleteCompanyRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 GetCompanies API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param String $filter A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. (optional) + # @param Integer $top If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. (optional) + # @param Integer $skip If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. (optional) + # @param String $order_by A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. (optional) + # @param Boolean $count If true, return the global count of elements in the collection. (optional) + # @param Boolean $count_only If true, return ONLY the global count of elements in the collection. It only applies when count=true. (optional) + # + class GetCompaniesRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :filter + + attr_accessor :top + + attr_accessor :skip + + attr_accessor :order_by + + attr_accessor :count + + attr_accessor :count_only + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_filter() + return @filter + end + + def set_filter(filter) + @filter = filter + end + + def get_top() + return @top + end + + def set_top(top) + @top = top + end + + def get_skip() + return @skip + end + + def set_skip(skip) + @skip = skip + end + + def get_order_by() + return @order_by + end + + def set_order_by(order_by) + @order_by = order_by + end + + def get_count() + return @count + end + + def set_count(count) + @count = count + end + + def get_count_only() + return @count_only + end + + def set_count_only(count_only) + @count_only = count_only + end + end + # Represents the Request object for the GetCompany API + # + # @param String $id Id of the company (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class GetCompanyRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 UpdateCompany API + # + # @param String $id The ID of the company to update (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param CompanyCreateUpdateRequestModel $company_create_update_request_model The updated company data (optional) + # + class UpdateCompanyRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :company_create_update_request_model + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_company_create_update_request_model() + return @company_create_update_request_model + end + + def set_company_create_update_request_model(company_create_update_request_model) + @company_create_update_request_model = company_create_update_request_model + end + end + end +end \ No newline at end of file diff --git a/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb b/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb new file mode 100644 index 0000000..03b921d --- /dev/null +++ b/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb @@ -0,0 +1,1191 @@ +=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) + + +=end + +require 'cgi' + +module AvalaraSdk::A1099 + module AvalaraSdk::A1099::V2 + class Forms1099Api + 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.6.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::A1099::V2.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 + + # 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\": 1, \"RecipientSecondName\": \"Jane Doe\", \"StreetAddress\": \"123 Main Street\", \"StreetAddressLine2\": \"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\": 1, \"streetAddress\": \"123 Center St\", \"streetAddressLine2\": \"\", \"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. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param dry_run [Boolean] # @param bulk_upsert1099_forms_request [BulkUpsert1099FormsRequest] + # @return [Form1099ProccessResult] + def bulk_upsert1099_forms(request_parameters) + data, _status_code, _headers = bulk_upsert1099_forms_with_http_info(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\": 1, \"RecipientSecondName\": \"Jane Doe\", \"StreetAddress\": \"123 Main Street\", \"StreetAddressLine2\": \"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\": 1, \"streetAddress\": \"123 Center St\", \"streetAddressLine2\": \"\", \"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. + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @param dry_run [Boolean] + # @param bulk_upsert1099_forms_request [BulkUpsert1099FormsRequest] + # @return [Array<(Form1099ProccessResult, Integer, Hash)>] Form1099ProccessResult data, response status code and response headers + def bulk_upsert1099_forms_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + dry_run = request_parameters.get_dry_run() + bulk_upsert1099_forms_request = request_parameters.get_bulk_upsert1099_forms_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 Forms1099Api.bulk_upsert1099_forms" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.bulk_upsert1099_forms" + end + # resource path + local_var_path = '/1099/forms/$bulk-upsert' + + # query parameters + query_params = {} + if !dry_run.nil? + query_params[:'dryRun'] = dry_run + end + + # 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', 'text/json', '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_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(bulk_upsert1099_forms_request) || {} + + # return_type + return_type = 'Form1099ProccessResult' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Forms1099Api.bulk_upsert1099_forms", + :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, :A1099) + 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 1099 form. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param i_create_form1099_request [ICreateForm1099Request] + # @return [FormResponseBase] + def create1099_form(request_parameters) + data, _status_code, _headers = create1099_form_with_http_info(request_parameters) + data + end + + # Creates a 1099 form. + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @param i_create_form1099_request [ICreateForm1099Request] + # @return [Array<(FormResponseBase, Integer, Hash)>] FormResponseBase data, response status code and response headers + def create1099_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + i_create_form1099_request = request_parameters.get_i_create_form1099_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 Forms1099Api.create1099_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.create1099_form" + end + # resource path + local_var_path = '/1099/forms' + + # 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', 'text/json', '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_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(i_create_form1099_request) || {} + + # return_type + return_type = 'FormResponseBase' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Forms1099Api.create1099_form", + :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, :A1099) + 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 1099 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 + # @return [nil] + def delete1099_form(request_parameters) + delete1099_form_with_http_info(request_parameters) + nil + end + + # Deletes a 1099 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 + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete1099_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 Forms1099Api.delete1099_form" + end + # 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 Forms1099Api.delete1099_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.delete1099_form" + end + # resource path + local_var_path = '/1099/forms/{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_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 => :"Forms1099Api.delete1099_form", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Retrieves a 1099 form. + # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [FormResponseBase] + def get1099_form(request_parameters) + data, _status_code, _headers = get1099_form_with_http_info(request_parameters) + data + end + + # Retrieves a 1099 form. + + # @param id [String] + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [Array<(FormResponseBase, Integer, Hash)>] FormResponseBase data, response status code and response headers + def get1099_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 Forms1099Api.get1099_form" + end + # 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 Forms1099Api.get1099_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.get1099_form" + end + # resource path + local_var_path = '/1099/forms/{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_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 = 'FormResponseBase' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Forms1099Api.get1099_form", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + 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 x_correlation_id [String] Unique correlation Id in a GUID format # @param mark_edelivered [Boolean] The parameter for marked e-delivered + # @return [FormResponseBase] + 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] + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @param mark_edelivered [Boolean] The parameter for marked e-delivered + # @return [Array<(FormResponseBase, Integer, Hash)>] FormResponseBase data, response status code and response headers + def get1099_form_pdf_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + mark_edelivered = request_parameters.get_mark_edelivered() + # 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 Forms1099Api.get1099_form_pdf" + end + # 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 Forms1099Api.get1099_form_pdf" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.get1099_form_pdf" + end + # resource path + local_var_path = '/1099/forms/{id}/pdf'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = {} + if !mark_edelivered.nil? + query_params[:'markEdelivered'] = mark_edelivered + 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_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 = 'FormResponseBase' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Forms1099Api.get1099_form_pdf", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Retrieves a list of 1099 forms based on query parameters. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @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 firstPayeeName 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 firstPayeeName updatedAt + # @return [Form1099List] + 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. + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @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 firstPayeeName 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 firstPayeeName updatedAt + # @return [Array<(Form1099List, Integer, Hash)>] Form1099List data, response status code and response headers + def list1099_forms_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + filter = request_parameters.get_filter() + top = request_parameters.get_top() + skip = request_parameters.get_skip() + order_by = request_parameters.get_order_by() + # 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 Forms1099Api.list1099_forms" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.list1099_forms" + end + # resource path + local_var_path = '/1099/forms' + + # query parameters + query_params = {} + if !filter.nil? + query_params[:'$filter'] = filter + end + if !top.nil? + query_params[:'$top'] = top + end + if !skip.nil? + query_params[:'$skip'] = skip + end + if !order_by.nil? + query_params[:'$orderBy'] = order_by + 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_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 = 'Form1099List' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Forms1099Api.list1099_forms", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Updates a 1099 form. + # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param i_update_form1099_request [IUpdateForm1099Request] + # @return [FormResponseBase] + def update1099_form(request_parameters) + data, _status_code, _headers = update1099_form_with_http_info(request_parameters) + data + end + + # Updates a 1099 form. + + # @param id [String] + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @param i_update_form1099_request [IUpdateForm1099Request] + # @return [Array<(FormResponseBase, Integer, Hash)>] FormResponseBase data, response status code and response headers + def update1099_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + i_update_form1099_request = request_parameters.get_i_update_form1099_request() + # 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 Forms1099Api.update1099_form" + end + # 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 Forms1099Api.update1099_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Forms1099Api.update1099_form" + end + # resource path + local_var_path = '/1099/forms/{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', 'text/json', '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_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(i_update_form1099_request) || {} + + # return_type + return_type = 'FormResponseBase' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Forms1099Api.update1099_form", + :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, :A1099) + 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 BulkUpsert1099Forms API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param Boolean $dry_run (optional, default to false) + # @param BulkUpsert1099FormsRequest $bulk_upsert1099_forms_request (optional) + # + class BulkUpsert1099FormsRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :dry_run + + attr_accessor :bulk_upsert1099_forms_request + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_dry_run() + return @dry_run + end + + def set_dry_run(dry_run) + @dry_run = dry_run + end + + def get_bulk_upsert1099_forms_request() + return @bulk_upsert1099_forms_request + end + + def set_bulk_upsert1099_forms_request(bulk_upsert1099_forms_request) + @bulk_upsert1099_forms_request = bulk_upsert1099_forms_request + end + end + # Represents the Request object for the Create1099Form API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param ICreateForm1099Request $i_create_form1099_request i_create_form1099_request (optional) + # + class Create1099FormRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :i_create_form1099_request + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_i_create_form1099_request() + return @i_create_form1099_request + end + + def set_i_create_form1099_request(i_create_form1099_request) + @i_create_form1099_request = i_create_form1099_request + end + end + # Represents the Request object for the Delete1099Form API + # + # @param String $id The unique identifier of the desired form to delete. (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class Delete1099FormRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 Get1099Form API + # + # @param String $id id (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class Get1099FormRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 Get1099FormPdf API + # + # @param String $id (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param Boolean $mark_edelivered The parameter for marked e-delivered (optional) + # + class Get1099FormPdfRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :mark_edelivered + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_mark_edelivered() + return @mark_edelivered + end + + def set_mark_edelivered(mark_edelivered) + @mark_edelivered = mark_edelivered + end + end + # Represents the Request object for the List1099Forms API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param String $filter 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 firstPayeeName mailStatus - possible values are: sent, unscheduled, pending, delivered referenceId tinMatchStatus - possible values are: none, pending, matched, failed type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC updatedAt validity - possible values are: true, false (optional) + # @param Integer $top If nonzero, return no more than this number of results. Used with skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. (optional, default to 10) + # @param Integer $skip If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. (optional, default to 0) + # @param String $order_by A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example issuerReferenceId ASC. Supported sorting fields are: issuerReferenceId taxYear createdAt firstPayeeName updatedAt (optional) + # + class List1099FormsRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :filter + + attr_accessor :top + + attr_accessor :skip + + attr_accessor :order_by + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_filter() + return @filter + end + + def set_filter(filter) + @filter = filter + end + + def get_top() + return @top + end + + def set_top(top) + @top = top + end + + def get_skip() + return @skip + end + + def set_skip(skip) + @skip = skip + end + + def get_order_by() + return @order_by + end + + def set_order_by(order_by) + @order_by = order_by + end + end + # Represents the Request object for the Update1099Form API + # + # @param String $id id (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param IUpdateForm1099Request $i_update_form1099_request i_update_form1099_request (optional) + # + class Update1099FormRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :i_update_form1099_request + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_i_update_form1099_request() + return @i_update_form1099_request + end + + def set_i_update_form1099_request(i_update_form1099_request) + @i_update_form1099_request = i_update_form1099_request + end + end + end +end \ No newline at end of file diff --git a/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb b/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb new file mode 100644 index 0000000..7aae8d7 --- /dev/null +++ b/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb @@ -0,0 +1,1326 @@ +=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) + + +=end + +require 'cgi' + +module AvalaraSdk::A1099 + module AvalaraSdk::A1099::V2 + class FormsW9Api + 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.6.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::A1099::V2.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 + + # 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 iw9_form_data_models_one_of [IW9FormDataModelsOneOf] Form to be created + # @return [IW9FormDataModelsOneOf] + 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 + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @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 + def create_w9_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + iw9_form_data_models_one_of = request_parameters.get_iw9_form_data_models_one_of() + # 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" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.create_w9_form" + end + # resource path + local_var_path = '/w9/forms' + + # 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', 'text/json', '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_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(iw9_form_data_models_one_of) || {} + + # return_type + return_type = 'IW9FormDataModelsOneOf' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.create_w9_form", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + 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 + # @return [nil] + def delete_w9_form(request_parameters) + delete_w9_form_with_http_info(request_parameters) + nil + 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 + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_w9_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 FormsW9Api.delete_w9_form" + end + # 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.delete_w9_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.delete_w9_form" + end + # resource path + local_var_path = '/w9/forms/{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_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 => :"FormsW9Api.delete_w9_form", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + 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 + # @return [IW9FormDataModelsOneOf] + 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 + + # @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 + # @return [Array<(IW9FormDataModelsOneOf, Integer, Hash)>] IW9FormDataModelsOneOf data, response status code and response headers + def get_w9_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 FormsW9Api.get_w9_form" + end + # 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.get_w9_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.get_w9_form" + end + # resource path + local_var_path = '/w9/forms/{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_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 = 'IW9FormDataModelsOneOf' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.get_w9_form", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Retrieve a form request + # Retrieve a form request after creation: not likely to be useful except in testing. Previously-valid form requests will be Not Found after `expires_at`. + # @param form_request_id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [FormRequestModel] + def get_w9_form_request(request_parameters) + data, _status_code, _headers = get_w9_form_request_with_http_info(request_parameters) + data + end + + # Retrieve a form request + # Retrieve a form request after creation: not likely to be useful except in testing. Previously-valid form requests will be Not Found after `expires_at`. + + # @param form_request_id [String] + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [Array<(FormRequestModel, Integer, Hash)>] FormRequestModel data, response status code and response headers + def get_w9_form_request_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + form_request_id = request_parameters.get_form_request_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # verify the required parameter 'form_request_id' is set + if @api_client.config.client_side_validation && form_request_id.nil? + fail ArgumentError, "Missing the required parameter 'form_request_id' when calling FormsW9Api.get_w9_form_request" + end + # 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.get_w9_form_request" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.get_w9_form_request" + end + # resource path + local_var_path = '/w9/forms/requests/{formRequestId}'.sub('{' + 'formRequestId' + '}', CGI.escape(form_request_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_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 = 'FormRequestModel' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.get_w9_form_request", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # List W9/W4/W8 forms. + # List W9/W4/W8 forms. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @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 + # @return [PaginatedW9FormsModel] + def list_w9_forms(request_parameters) + data, _status_code, _headers = list_w9_forms_with_http_info(request_parameters) + data + end + + # List W9/W4/W8 forms. + # List W9/W4/W8 forms. + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @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 + # @return [Array<(PaginatedW9FormsModel, Integer, Hash)>] PaginatedW9FormsModel data, response status code and response headers + def list_w9_forms_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + filter = request_parameters.get_filter() + top = request_parameters.get_top() + skip = request_parameters.get_skip() + order_by = request_parameters.get_order_by() + count = request_parameters.get_count() + # 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.list_w9_forms" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.list_w9_forms" + end + # resource path + local_var_path = '/w9/forms' + + # query parameters + query_params = {} + if !filter.nil? + query_params[:'$filter'] = filter + end + if !top.nil? + query_params[:'$top'] = top + end + if !skip.nil? + query_params[:'$skip'] = skip + end + if !order_by.nil? + query_params[:'$orderBy'] = order_by + end + if !count.nil? + query_params[:'count'] = count + 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_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 = 'PaginatedW9FormsModel' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.list_w9_forms", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Sends a W9 email request to a vendor/payee + # @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 + # @return [IW9FormDataModelsOneOf] + def send_w9_form_email(request_parameters) + data, _status_code, _headers = send_w9_form_email_with_http_info(request_parameters) + data + end + + # Sends a W9 email request to a vendor/payee + + # @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 + # @return [Array<(IW9FormDataModelsOneOf, Integer, Hash)>] IW9FormDataModelsOneOf data, response status code and response headers + def send_w9_form_email_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 FormsW9Api.send_w9_form_email" + end + # 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.send_w9_form_email" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.send_w9_form_email" + end + # resource path + local_var_path = '/w9/forms/{id}/$send-email'.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_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 = 'IW9FormDataModelsOneOf' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.send_w9_form_email", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + 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 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) + data + 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 iw9_form_data_models_one_of [IW9FormDataModelsOneOf] Form to be updated + # @return [Array<(IW9FormDataModelsOneOf, Integer, Hash)>] IW9FormDataModelsOneOf data, response status code and response headers + def update_w9_form_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + iw9_form_data_models_one_of = request_parameters.get_iw9_form_data_models_one_of() + # 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 FormsW9Api.update_w9_form" + end + # 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.update_w9_form" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.update_w9_form" + end + # resource path + local_var_path = '/w9/forms/{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', 'text/json', '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_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(iw9_form_data_models_one_of) || {} + + # return_type + return_type = 'IW9FormDataModelsOneOf' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.update_w9_form", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Upload files for a W9/W4/W8 form + # Upload files 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 file [File] + # @return [String] + def upload_w9_files(request_parameters) + data, _status_code, _headers = upload_w9_files_with_http_info(request_parameters) + data + end + + # Upload files for a W9/W4/W8 form + # Upload files 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 file [File] + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + def upload_w9_files_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + file = request_parameters.get_file() + # 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 FormsW9Api.upload_w9_files" + end + # 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.upload_w9_files" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling FormsW9Api.upload_w9_files" + end + # resource path + local_var_path = '/w9/forms/{id}/attachment'.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(['multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-Id'] = x_correlation_id + end + + # form parameters + form_params = {} + if !file.nil? + form_params['file'] = file + end + + # http body (model) + post_body = {} + + # return_type + return_type = 'String' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"FormsW9Api.upload_w9_files", + :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, :A1099) + 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 CreateW9Form API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param IW9FormDataModelsOneOf $iw9_form_data_models_one_of Form to be created (optional) + # + class CreateW9FormRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :iw9_form_data_models_one_of + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_iw9_form_data_models_one_of() + return @iw9_form_data_models_one_of + 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 + end + end + # Represents the Request object for the DeleteW9Form API + # + # @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 (required) + # + class DeleteW9FormRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 GetW9Form API + # + # @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 (required) + # + class GetW9FormRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 GetW9FormRequest API + # + # @param String $form_request_id (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class GetW9FormRequestRequestSdk + attr_accessor :form_request_id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_form_request_id() + return @form_request_id + end + + def set_form_request_id(form_request_id) + @form_request_id = form_request_id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 ListW9Forms API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param String $filter A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. (optional) + # @param Integer $top If nonzero, return no more than this number of results. Used with skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. (optional, default to 10) + # @param Integer $skip If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. (optional, default to 0) + # @param String $order_by A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. (optional) + # @param Boolean $count When true, returns a @recordSetCount in the result set (optional) + # + class ListW9FormsRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :filter + + attr_accessor :top + + attr_accessor :skip + + attr_accessor :order_by + + attr_accessor :count + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_filter() + return @filter + end + + def set_filter(filter) + @filter = filter + end + + def get_top() + return @top + end + + def set_top(top) + @top = top + end + + def get_skip() + return @skip + end + + def set_skip(skip) + @skip = skip + end + + def get_order_by() + return @order_by + end + + def set_order_by(order_by) + @order_by = order_by + end + + def get_count() + return @count + end + + def set_count(count) + @count = count + end + end + # Represents the Request object for the SendW9FormEmail API + # + # @param String $id The ID of the W9/W4/W8 form. (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class SendW9FormEmailRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 UpdateW9Form API + # + # @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 (required) + # @param IW9FormDataModelsOneOf $iw9_form_data_models_one_of Form to be updated (optional) + # + class UpdateW9FormRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :iw9_form_data_models_one_of + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_iw9_form_data_models_one_of() + return @iw9_form_data_models_one_of + 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 + end + end + # Represents the Request object for the UploadW9Files API + # + # @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 (required) + # @param File $file file (optional) + # + class UploadW9FilesRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :file + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_file() + return @file + end + + def set_file(file) + @file = file + end + end + end +end \ No newline at end of file diff --git a/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb b/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb new file mode 100644 index 0000000..0d5cbdc --- /dev/null +++ b/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb @@ -0,0 +1,952 @@ +=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) + + +=end + +require 'cgi' + +module AvalaraSdk::A1099 + module AvalaraSdk::A1099::V2 + class Issuers1099Api + 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.6.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::A1099::V2.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 + + # Create an issuer + # Create a new issuer + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param issuer_command [IssuerCommand] The issuer to create + # @return [IssuerResponse] + def create_issuer(request_parameters) + data, _status_code, _headers = create_issuer_with_http_info(request_parameters) + data + end + + # Create an issuer + # Create a new issuer + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @param issuer_command [IssuerCommand] The issuer to create + # @return [Array<(IssuerResponse, Integer, Hash)>] IssuerResponse data, response status code and response headers + def create_issuer_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + issuer_command = request_parameters.get_issuer_command() + # 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 Issuers1099Api.create_issuer" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Issuers1099Api.create_issuer" + end + # resource path + local_var_path = '/1099/issuers' + + # 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', 'text/json', '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_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(issuer_command) || {} + + # return_type + return_type = 'IssuerResponse' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Issuers1099Api.create_issuer", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Delete an issuer + # Delete an issuer + # @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 + # @return [nil] + def delete_issuer(request_parameters) + delete_issuer_with_http_info(request_parameters) + nil + end + + # Delete an issuer + # Delete an issuer + + # @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 + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_issuer_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 Issuers1099Api.delete_issuer" + end + # 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 Issuers1099Api.delete_issuer" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Issuers1099Api.delete_issuer" + end + # resource path + local_var_path = '/1099/issuers/{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_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 => :"Issuers1099Api.delete_issuer", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + 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 + # @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 + + # @param id [String] + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [Array<(IssuerResponse, Integer, Hash)>] IssuerResponse data, response status code and response headers + def get_issuer_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 Issuers1099Api.get_issuer" + end + # 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 Issuers1099Api.get_issuer" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Issuers1099Api.get_issuer" + end + # resource path + local_var_path = '/1099/issuers/{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_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 = 'IssuerResponse' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Issuers1099Api.get_issuer", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # List issuers + # List issuers for a given tax year. Filterable fields are name, referenceId and taxYear + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @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. + # @return [PaginatedQueryResultModelIssuerResponse] + def get_issuers(request_parameters) + data, _status_code, _headers = get_issuers_with_http_info(request_parameters) + data + end + + # List issuers + # List issuers for a given tax year. Filterable fields are name, referenceId and taxYear + + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @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. + # @return [Array<(PaginatedQueryResultModelIssuerResponse, Integer, Hash)>] PaginatedQueryResultModelIssuerResponse data, response status code and response headers + def get_issuers_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + filter = request_parameters.get_filter() + top = request_parameters.get_top() + skip = request_parameters.get_skip() + order_by = request_parameters.get_order_by() + count = request_parameters.get_count() + count_only = request_parameters.get_count_only() + # 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 Issuers1099Api.get_issuers" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Issuers1099Api.get_issuers" + end + # resource path + local_var_path = '/1099/issuers' + + # query parameters + query_params = {} + if !filter.nil? + query_params[:'$filter'] = filter + end + if !top.nil? + query_params[:'$top'] = top + end + if !skip.nil? + query_params[:'$skip'] = skip + end + if !order_by.nil? + query_params[:'$orderBy'] = order_by + end + if !count.nil? + query_params[:'count'] = count + end + if !count_only.nil? + query_params[:'countOnly'] = count_only + 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_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 = 'PaginatedQueryResultModelIssuerResponse' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Issuers1099Api.get_issuers", + :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, :A1099) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + 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 issuer_command [IssuerCommand] The issuer to update + # @return [nil] + def update_issuer(request_parameters) + update_issuer_with_http_info(request_parameters) + nil + 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 issuer_command [IssuerCommand] The issuer to update + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_issuer_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + issuer_command = request_parameters.get_issuer_command() + # 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 Issuers1099Api.update_issuer" + end + # 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 Issuers1099Api.update_issuer" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Issuers1099Api.update_issuer" + end + # resource path + local_var_path = '/1099/issuers/{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', 'text/json', '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_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(issuer_command) || {} + + # return_type + return_type = '' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Issuers1099Api.update_issuer", + :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, :A1099) + 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 CreateIssuer API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param IssuerCommand $issuer_command The issuer to create (optional) + # + class CreateIssuerRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :issuer_command + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_issuer_command() + return @issuer_command + end + + def set_issuer_command(issuer_command) + @issuer_command = issuer_command + end + end + # Represents the Request object for the DeleteIssuer API + # + # @param String $id Id of the issuer to delete (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class DeleteIssuerRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 GetIssuer API + # + # @param String $id id (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class GetIssuerRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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 GetIssuers API + # + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # @param String $filter A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. (optional) + # @param Integer $top If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. (optional) + # @param Integer $skip If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. (optional) + # @param String $order_by A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. (optional) + # @param Boolean $count If true, return the global count of elements in the collection. (optional) + # @param Boolean $count_only If true, return ONLY the global count of elements in the collection. It only applies when count=true. (optional) + # + class GetIssuersRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :filter + + attr_accessor :top + + attr_accessor :skip + + attr_accessor :order_by + + attr_accessor :count + + attr_accessor :count_only + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_filter() + return @filter + end + + def set_filter(filter) + @filter = filter + end + + def get_top() + return @top + end + + def set_top(top) + @top = top + end + + def get_skip() + return @skip + end + + def set_skip(skip) + @skip = skip + end + + def get_order_by() + return @order_by + end + + def set_order_by(order_by) + @order_by = order_by + end + + def get_count() + return @count + end + + def set_count(count) + @count = count + end + + def get_count_only() + return @count_only + end + + def set_count_only(count_only) + @count_only = count_only + end + end + # Represents the Request object for the UpdateIssuer API + # + # @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 (required) + # @param IssuerCommand $issuer_command The issuer to update (optional) + # + class UpdateIssuerRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :issuer_command + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_issuer_command() + return @issuer_command + end + + def set_issuer_command(issuer_command) + @issuer_command = issuer_command + end + end + end +end \ No newline at end of file diff --git a/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb b/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb new file mode 100644 index 0000000..51aa771 --- /dev/null +++ b/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb @@ -0,0 +1,354 @@ +=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) + + +=end + +require 'cgi' + +module AvalaraSdk::A1099 + module AvalaraSdk::A1099::V2 + class Jobs1099Api + 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.6.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::A1099::V2.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 + + # Retrieves information about the job + # Retrieves information about the job + # @param id [String] Job id obtained from other API responses, like `/1099/bulk-upsert`. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [JobResult] + def get_job(request_parameters) + data, _status_code, _headers = get_job_with_http_info(request_parameters) + data + end + + # Retrieves information about the job + # Retrieves information about the job + + # @param id [String] Job id obtained from other API responses, like `/1099/bulk-upsert`. + # @param avalara_version [String] API version + # @param x_correlation_id [String] Unique correlation Id in a GUID format + # @return [Array<(JobResult, Integer, Hash)>] JobResult data, response status code and response headers + def get_job_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + id = request_parameters.get_id() + avalara_version = request_parameters.get_avalara_version() + x_correlation_id = request_parameters.get_x_correlation_id() + # 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 Jobs1099Api.get_job" + end + # 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 Jobs1099Api.get_job" + end + # verify the required parameter 'x_correlation_id' is set + if @api_client.config.client_side_validation && x_correlation_id.nil? + fail ArgumentError, "Missing the required parameter 'x_correlation_id' when calling Jobs1099Api.get_job" + end + # resource path + local_var_path = '/1099/jobs/{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_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 = 'JobResult' + + # auth_names + auth_names = ['bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"Jobs1099Api.get_job", + :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, :A1099) + 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 GetJob API + # + # @param String $id Job id obtained from other API responses, like `/1099/bulk-upsert`. (required) + # @param String $avalara_version API version (required) + # @param String $x_correlation_id Unique correlation Id in a GUID format (required) + # + class GetJobRequestSdk + attr_accessor :id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_avalara_version() + return @avalara_version || '2.0' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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/data_input_fields_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb index 80f6325..35513f8 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("24.12.1") + api_client.set_sdk_version("25.6.0") @api_client = api_client end @@ -316,7 +316,7 @@ def get_data_input_fields_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -335,7 +335,7 @@ def get_data_input_fields_with_http_info(request_parameters) # @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) # - class GetDataInputFieldsRequest + class GetDataInputFieldsRequestSdk attr_accessor :avalara_version attr_accessor :x_avalara_client @@ -354,7 +354,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' 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 8211789..951dad5 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("24.12.1") + api_client.set_sdk_version("25.6.0") @api_client = api_client end @@ -306,7 +306,7 @@ def download_document_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -317,7 +317,7 @@ def download_document_with_http_info(request_parameters) # Fetch the inbound document from a tax authority # This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param document_fetch_request [DocumentFetchRequest] # @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 fetch_documents_request [FetchDocumentsRequest] # @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. # @return [DocumentFetch] def fetch_documents(request_parameters) data, _status_code, _headers = fetch_documents_with_http_info(request_parameters) @@ -328,7 +328,7 @@ def fetch_documents(request_parameters) # This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number. # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used - # @param document_fetch_request [DocumentFetchRequest] + # @param fetch_documents_request [FetchDocumentsRequest] # @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. # @return [Array<(DocumentFetch, Integer, Hash)>] DocumentFetch data, response status code and response headers def fetch_documents_with_http_info(request_parameters) @@ -336,15 +336,15 @@ def fetch_documents_with_http_info(request_parameters) required_scopes = '' # Request Parameters avalara_version = request_parameters.get_avalara_version() - document_fetch_request = request_parameters.get_document_fetch_request() + fetch_documents_request = request_parameters.get_fetch_documents_request() x_avalara_client = request_parameters.get_x_avalara_client() # 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 DocumentsApi.fetch_documents" end - # verify the required parameter 'document_fetch_request' is set - if @api_client.config.client_side_validation && document_fetch_request.nil? - fail ArgumentError, "Missing the required parameter 'document_fetch_request' when calling DocumentsApi.fetch_documents" + # verify the required parameter 'fetch_documents_request' is set + if @api_client.config.client_side_validation && fetch_documents_request.nil? + fail ArgumentError, "Missing the required parameter 'fetch_documents_request' when calling DocumentsApi.fetch_documents" end # resource path local_var_path = '/einvoicing/documents/$fetch' @@ -372,7 +372,7 @@ def fetch_documents_with_http_info(request_parameters) form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(document_fetch_request) || {} + post_body = @api_client.object_to_http_body(fetch_documents_request) || {} # return_type return_type = 'DocumentFetch' @@ -392,7 +392,7 @@ def fetch_documents_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes) + 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 @@ -507,7 +507,7 @@ def get_document_list_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -588,7 +588,7 @@ def get_document_status_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -599,7 +599,7 @@ def get_document_status_with_http_info(request_parameters) # Submits a document to Avalara E-Invoicing API # When a UBL document is sent to this endpoint, it generates a document in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.

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

Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param metadata [SubmitDocumentMetadata] # @param data [String] The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' # @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 metadata [SubmitDocumentMetadata] # @param data [Object] The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' # @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. # @return [DocumentSubmitResponse] def submit_document(request_parameters) data, _status_code, _headers = submit_document_with_http_info(request_parameters) @@ -611,7 +611,7 @@ def submit_document(request_parameters) # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param metadata [SubmitDocumentMetadata] - # @param data [String] The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' + # @param data [Object] The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' # @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. # @return [Array<(DocumentSubmitResponse, Integer, Hash)>] DocumentSubmitResponse data, response status code and response headers def submit_document_with_http_info(request_parameters) @@ -686,7 +686,7 @@ def submit_document_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes) + 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 @@ -702,7 +702,7 @@ def submit_document_with_http_info(request_parameters) # @param String $document_id The unique ID for this document that was returned in the POST /einvoicing/document response body (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # - class DownloadDocumentRequest + class DownloadDocumentRequestSdk attr_accessor :avalara_version attr_accessor :accept @@ -715,7 +715,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -749,13 +749,13 @@ def set_x_avalara_client(x_avalara_client) # Represents the Request object for the FetchDocuments API # # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - # @param DocumentFetchRequest $document_fetch_request document_fetch_request (required) + # @param FetchDocumentsRequest $fetch_documents_request fetch_documents_request (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # - class FetchDocumentsRequest + class FetchDocumentsRequestSdk attr_accessor :avalara_version - attr_accessor :document_fetch_request + attr_accessor :fetch_documents_request attr_accessor :x_avalara_client @@ -763,19 +763,19 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @avalara_version = avalara_version end - def get_document_fetch_request() - return @document_fetch_request + def get_fetch_documents_request() + return @fetch_documents_request end - def set_document_fetch_request(document_fetch_request) - @document_fetch_request = document_fetch_request + def set_fetch_documents_request(fetch_documents_request) + @fetch_documents_request = fetch_documents_request end def get_x_avalara_client() @@ -799,7 +799,7 @@ def set_x_avalara_client(x_avalara_client) # @param Float $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. (optional) # @param String $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) # - class GetDocumentListRequest + class GetDocumentListRequestSdk attr_accessor :avalara_version attr_accessor :x_avalara_client @@ -824,7 +824,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -909,7 +909,7 @@ def set_skip(skip) # @param String $document_id The unique ID for this document that was returned in the POST /einvoicing/documents response body (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # - class GetDocumentStatusRequest + class GetDocumentStatusRequestSdk attr_accessor :avalara_version attr_accessor :document_id @@ -920,7 +920,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -947,10 +947,10 @@ 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 SubmitDocumentMetadata $metadata metadata (required) - # @param String $data The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' (required) + # @param Object $data The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # - class SubmitDocumentRequest + class SubmitDocumentRequestSdk attr_accessor :avalara_version attr_accessor :metadata @@ -963,7 +963,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' 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 f9b4506..f33824b 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("24.12.1") + api_client.set_sdk_version("25.6.0") @api_client = api_client end @@ -268,7 +268,7 @@ def submit_interop_document_with_http_info(request_parameters) fail ArgumentError, "Missing the required parameter 'interchange_type' when calling InteropApi.submit_interop_document" end # verify enum value - allowable_values = ["FI-B2B", "FI-B2C", "FI-B2G"] + allowable_values = ["FI-B2B-TIEKE", "FI-B2G-TIEKE"] if @api_client.config.client_side_validation && !allowable_values.include?(interchange_type) fail ArgumentError, "invalid value for \"interchange_type\", must be one of #{allowable_values}" end @@ -334,7 +334,7 @@ def submit_interop_document_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes) + 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 @@ -352,7 +352,7 @@ def submit_interop_document_with_http_info(request_parameters) # @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 File $file_name The file to be uploaded (e.g., UBL XML, CII XML). (optional) # - class SubmitInteropDocumentRequest + class SubmitInteropDocumentRequestSdk attr_accessor :document_type attr_accessor :interchange_type @@ -385,7 +385,7 @@ def set_interchange_type(interchange_type) end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' 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 d2123d6..a104c41 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("24.12.1") + api_client.set_sdk_version("25.6.0") @api_client = api_client end @@ -315,7 +315,7 @@ def get_mandate_data_input_fields_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -415,7 +415,7 @@ def get_mandates_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -432,7 +432,7 @@ def get_mandates_with_http_info(request_parameters) # @param String $document_version Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # - class GetMandateDataInputFieldsRequest + class GetMandateDataInputFieldsRequestSdk attr_accessor :avalara_version attr_accessor :mandate_id @@ -447,7 +447,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -496,7 +496,7 @@ def set_x_avalara_client(x_avalara_client) # @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) # - class GetMandatesRequest + class GetMandatesRequestSdk attr_accessor :avalara_version attr_accessor :x_avalara_client @@ -515,7 +515,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' 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 new file mode 100644 index 0000000..028ac4a --- /dev/null +++ b/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb @@ -0,0 +1,829 @@ +=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 SubscriptionsApi + 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.6.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 + + # 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 + # @return [SuccessResponse] + def create_webhook_subscription(request_parameters) + data, _status_code, _headers = create_webhook_subscription_with_http_info(request_parameters) + data + end + + # 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 + # @return [Array<(SuccessResponse, Integer, Hash)>] SuccessResponse data, response status code and response headers + def create_webhook_subscription_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + subscription_registration = request_parameters.get_subscription_registration() + x_correlation_id = request_parameters.get_x_correlation_id() + x_avalara_client = request_parameters.get_x_avalara_client() + # 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 SubscriptionsApi.create_webhook_subscription" + end + # verify the required parameter 'subscription_registration' is set + if @api_client.config.client_side_validation && subscription_registration.nil? + fail ArgumentError, "Missing the required parameter 'subscription_registration' when calling SubscriptionsApi.create_webhook_subscription" + end + # resource path + local_var_path = '/einvoicing/webhooks/subscriptions' + + # 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_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(subscription_registration) || {} + + # return_type + return_type = 'SuccessResponse' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"SubscriptionsApi.create_webhook_subscription", + :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 + + # 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 + # @return [nil] + def delete_webhook_subscription(request_parameters) + delete_webhook_subscription_with_http_info(request_parameters) + nil + end + + # 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 + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_webhook_subscription_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + subscription_id = request_parameters.get_subscription_id() + 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() + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.delete_webhook_subscription" + end + # 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 SubscriptionsApi.delete_webhook_subscription" + end + # resource path + local_var_path = '/einvoicing/webhooks/subscriptions/{subscription-id}'.sub('{' + 'subscription-id' + '}', CGI.escape(subscription_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_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + 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 => :"SubscriptionsApi.delete_webhook_subscription", + :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 + + # 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 + # @return [SubscriptionDetail] + def get_webhook_subscription(request_parameters) + data, _status_code, _headers = get_webhook_subscription_with_http_info(request_parameters) + data + end + + # 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 + # @return [Array<(SubscriptionDetail, Integer, Hash)>] SubscriptionDetail data, response status code and response headers + def get_webhook_subscription_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + subscription_id = request_parameters.get_subscription_id() + 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() + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_webhook_subscription" + end + # 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 SubscriptionsApi.get_webhook_subscription" + end + # resource path + local_var_path = '/einvoicing/webhooks/subscriptions/{subscription-id}'.sub('{' + 'subscription-id' + '}', CGI.escape(subscription_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_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + + # form parameters + form_params = {} + + # http body (model) + post_body = {} + + # return_type + return_type = 'SubscriptionDetail' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"SubscriptionsApi.get_webhook_subscription", + :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 + + # 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 [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) + data + end + + # 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 [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 + def list_webhook_subscriptions_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # 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() + top = request_parameters.get_top() + skip = request_parameters.get_skip() + count = request_parameters.get_count() + count_only = request_parameters.get_count_only() + # 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 SubscriptionsApi.list_webhook_subscriptions" + end + # resource path + local_var_path = '/einvoicing/webhooks/subscriptions' + + # query parameters + query_params = {} + if !top.nil? + query_params[:'$top'] = top + end + if !skip.nil? + query_params[:'$skip'] = skip + end + if !count.nil? + query_params[:'count'] = count + end + if !count_only.nil? + query_params[:'countOnly'] = count_only + 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_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + + # form parameters + form_params = {} + + # http body (model) + post_body = {} + + # return_type + return_type = 'SubscriptionListResponse' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"SubscriptionsApi.list_webhook_subscriptions", + :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 + 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 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) + # + class CreateWebhookSubscriptionRequestSdk + attr_accessor :avalara_version + + attr_accessor :subscription_registration + + attr_accessor :x_correlation_id + + attr_accessor :x_avalara_client + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.3' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_subscription_registration() + return @subscription_registration + end + + def set_subscription_registration(subscription_registration) + @subscription_registration = subscription_registration + 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_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + end + # 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 $x_correlation_id A unique identifier for tracking the request and its response (optional) + # @param String $x_avalara_client Client application identification (optional) + # + class DeleteWebhookSubscriptionRequestSdk + attr_accessor :subscription_id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :x_avalara_client + + def initialize() + end + + def get_subscription_id() + return @subscription_id + end + + def set_subscription_id(subscription_id) + @subscription_id = subscription_id + end + + def get_avalara_version() + return @avalara_version || '1.3' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + end + # 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 $x_correlation_id A unique identifier for tracking the request and its response (optional) + # @param String $x_avalara_client Client application identification (optional) + # + class GetWebhookSubscriptionRequestSdk + attr_accessor :subscription_id + + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :x_avalara_client + + def initialize() + end + + def get_subscription_id() + return @subscription_id + end + + def set_subscription_id(subscription_id) + @subscription_id = subscription_id + end + + def get_avalara_version() + return @avalara_version || '1.3' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + 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 $x_correlation_id A unique identifier for tracking the request and its response (optional) + # @param String $x_avalara_client Client application identification (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) + # + class ListWebhookSubscriptionsRequestSdk + attr_accessor :avalara_version + + attr_accessor :x_correlation_id + + attr_accessor :x_avalara_client + + attr_accessor :top + + attr_accessor :skip + + attr_accessor :count + + attr_accessor :count_only + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.3' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + 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_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_top() + return @top + end + + def set_top(top) + @top = top + end + + def get_skip() + return @skip + end + + def set_skip(skip) + @skip = skip + end + + def get_count() + return @count + end + + def set_count(count) + @count = count + end + + def get_count_only() + return @count_only + end + + def set_count_only(count_only) + @count_only = count_only + 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 59e0f31..b03dec7 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("24.12.1") + api_client.set_sdk_version("25.6.0") @api_client = api_client end @@ -228,10 +228,10 @@ def build_collection_param(param, collection_format) # 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. - # @return [nil] + # @return [BatchSearchParticipants202Response] def batch_search_participants(request_parameters) - batch_search_participants_with_http_info(request_parameters) - nil + 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. @@ -243,7 +243,7 @@ def batch_search_participants(request_parameters) # @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. - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + # @return [Array<(BatchSearchParticipants202Response, Integer, Hash)>] BatchSearchParticipants202Response data, response status code and response headers def batch_search_participants_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -311,7 +311,7 @@ def batch_search_participants_with_http_info(request_parameters) post_body = {} # return_type - return_type = '' + return_type = 'BatchSearchParticipants202Response' # auth_names auth_names = ['Bearer'] @@ -328,7 +328,7 @@ def batch_search_participants_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes) + 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 @@ -414,7 +414,7 @@ def download_batch_search_report_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -424,7 +424,7 @@ def download_batch_search_report_with_http_info(request_parameters) end # Get the batch search details for a given id. - # 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. # @return [BatchSearch] def get_batch_search_detail(request_parameters) @@ -433,7 +433,7 @@ def get_batch_search_detail(request_parameters) end # Get the batch search details for a given id. - # 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. @@ -500,7 +500,7 @@ def get_batch_search_detail_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -510,7 +510,7 @@ def get_batch_search_detail_with_http_info(request_parameters) end # List all batch searches that were previously submitted. - # Retrieves all batch searches performed by the user. + # 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 [String] If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. # @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 [BatchSearchListResponse] def list_batch_searches(request_parameters) @@ -519,7 +519,7 @@ def list_batch_searches(request_parameters) end # List all batch searches that were previously submitted. - # Retrieves all batch searches performed by the user. + # 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\" @@ -605,7 +605,7 @@ def list_batch_searches_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -615,7 +615,7 @@ def list_batch_searches_with_http_info(request_parameters) end # Returns a list of participants matching the input query. - # 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 [String] If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. # @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] def search_participants(request_parameters) @@ -624,7 +624,7 @@ def search_participants(request_parameters) end # Returns a list of participants matching the input query. - # 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. @@ -719,7 +719,7 @@ def search_participants_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes) + 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 @@ -737,7 +737,7 @@ def search_participants_with_http_info(request_parameters) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # - class BatchSearchParticipantsRequest + class BatchSearchParticipantsRequestSdk attr_accessor :avalara_version attr_accessor :name @@ -754,7 +754,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -808,7 +808,7 @@ def set_x_correlation_id(x_correlation_id) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # - class DownloadBatchSearchReportRequest + class DownloadBatchSearchReportRequestSdk attr_accessor :avalara_version attr_accessor :id @@ -821,7 +821,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -859,7 +859,7 @@ def set_x_correlation_id(x_correlation_id) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # - class GetBatchSearchDetailRequest + class GetBatchSearchDetailRequestSdk attr_accessor :avalara_version attr_accessor :id @@ -872,7 +872,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -914,7 +914,7 @@ def set_x_correlation_id(x_correlation_id) # @param String $order_by The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # - class ListBatchSearchesRequest + class ListBatchSearchesRequestSdk attr_accessor :avalara_version attr_accessor :x_avalara_client @@ -935,7 +935,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) @@ -1010,7 +1010,7 @@ def set_x_correlation_id(x_correlation_id) # @param String $order_by The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # - class SearchParticipantsRequest + class SearchParticipantsRequestSdk attr_accessor :avalara_version attr_accessor :search @@ -1033,7 +1033,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.2' + return @avalara_version || '1.3' end def set_avalara_version(avalara_version) diff --git a/lib/avalara_sdk/api_client.rb b/lib/avalara_sdk/api_client.rb index 51f6e4c..b31c5dd 100644 --- a/lib/avalara_sdk/api_client.rb +++ b/lib/avalara_sdk/api_client.rb @@ -20,6 +20,7 @@ require 'faraday' require 'avalara_sdk/token_metadata' require 'avalara_sdk/response_hash' +require 'ostruct' module AvalaraSdk class ApiClient @@ -52,7 +53,6 @@ def initialize(config) fail ArgumentError,'configuration is nil' end - @base_path=config.base_url() @sdk_version="" @config = config @default_headers = { @@ -76,7 +76,7 @@ def set_sdk_version(sdk_version="") # # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = false) + def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = false, microservice = AvalaraSdk::AvalaraMicroservice::NONE) ssl_options = { :ca_file => @config.ssl_ca_file, :verify => @config.ssl_verify, @@ -85,7 +85,8 @@ def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = fals :client_key => @config.ssl_client_key } - connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| + base_url = @config.get_base_path(microservice) + connection = Faraday.new(:url => base_url, :ssl => ssl_options) do |conn| @config.configure_middleware(conn) if opts[:header_params]["Content-Type"] == "multipart/form-data" conn.request :multipart @@ -109,7 +110,7 @@ def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = fals values = authorization_header.split(" ") if !values.nil? && values.length == 2 update_oauth_access_token(required_scopes, values[1]) - call_api(http_method, path, opts, required_scopes, true) + call_api(http_method, path, opts, required_scopes, true, microservice) end elsif response.status == 0 @@ -234,7 +235,8 @@ def sanitize_filename(filename) def build_request_url(path, opts = {}) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - @config.base_url() + path + # Return path only since base URL is now set on the Faraday connection + path end # Sets user agent in HTTP header diff --git a/lib/avalara_sdk/configuration.rb b/lib/avalara_sdk/configuration.rb index e7f32bc..ce7e5fd 100644 --- a/lib/avalara_sdk/configuration.rb +++ b/lib/avalara_sdk/configuration.rb @@ -15,6 +15,18 @@ class Configuration FALLBACK_TOKEN_URL = 'https://identity.avalara.com/connect/token' FALLBACK_DEVICE_AUTHORIZATION_URL = 'https://identity.avalara.com/connect/token' + # Official URL of EInvoicing Service (Production by Environment) + EINVOICING_SERVICE_PRODUCTION_URL = 'https://api.avalara.com' + EINVOICING_SERVICE_SANDBOX_URL = 'https://api.sbx.avalara.com' + EINVOICING_SERVICE_QA_URL = 'https://superapi.qa.avalara.io' + EINVOICING_SERVICE_DEV_URL = 'https://superapi.dev.avalara.io' + + # Official URL of A1099 Service (Production by Environment) + A1099_SERVICE_PRODUCTION_URL = 'https://api.avalara.com/avalara1099' + A1099_SERVICE_SANDBOX_URL = 'https://api.sbx.avalara.com/avalara1099' + A1099_SERVICE_QA_URL = 'https://api-ava1099.gamma.qa.us-west-2.aws.avalara.io' + A1099_SERVICE_DEV_URL = 'https://api-ava1099.gamma.dev.us-west-2.aws.avalara.io' + # Defines environment attr_accessor :environment @@ -206,23 +218,49 @@ def base_path=(base_path) @base_path=base_path end - # Returns base URL for specified operation based on server settings - def base_url - case environment.downcase - when 'sandbox' - return 'https://api.sbx.avalara.com' - when 'production' - return 'https://api.avalara.com' - when 'qa' - return 'https://superapi.qa.avalara.io' - when 'test' - if test_base_path.empty? - fail ArgumentError, "Test_Base_Path must be configured to run in test environment mode." + # Returns base URL for specified operation based on server settings and microservice + def get_base_path(microservice = :none) + puts "get_base_path called with microservice = #{microservice.inspect}" + + if environment.downcase == 'test' && test_base_path.empty? + fail ArgumentError, "Test_Base_Path must be configured to run in test environment mode." + end + + case microservice + when :EInvoicing + case environment.downcase + when 'production' + return EINVOICING_SERVICE_PRODUCTION_URL + when 'sandbox' + return EINVOICING_SERVICE_SANDBOX_URL + when 'qa' + return EINVOICING_SERVICE_QA_URL + when 'dev' + return EINVOICING_SERVICE_DEV_URL + when 'test' + return test_base_path + else + fail ArgumentError, 'Environment not configured correctly, Acceptable values are "production", "sandbox", "qa", "dev", and "test".' end - return test_base_path - else - fail ArgumentError, "Invalid environment value" + when :A1099 + case environment.downcase + when 'production' + return A1099_SERVICE_PRODUCTION_URL + when 'sandbox' + return A1099_SERVICE_SANDBOX_URL + when 'qa' + return A1099_SERVICE_QA_URL + when 'dev' + return A1099_SERVICE_DEV_URL + when 'test' + return test_base_path + else + fail ArgumentError, 'Environment not configured correctly, Acceptable values are "production", "sandbox", "qa", "dev", and "test".' + end + when :none + fail ArgumentError, 'Microservice not configured correctly, Acceptable values are "EInvoicing", "A1099", and "none".' end + end # Gets API key (with prefix if set). @@ -327,4 +365,11 @@ def get_token_url(openid_connect_url) JSON.parse(response.body) end end + + # Microservice enumeration + module AvalaraMicroservice + EINVOICING = :EInvoicing + A1099 = :A1099 + NONE = :none + end end diff --git a/lib/avalara_sdk/models/A1099/V2/attribute.rb b/lib/avalara_sdk/models/A1099/V2/attribute.rb new file mode 100644 index 0000000..e247f7e --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/attribute.rb @@ -0,0 +1,379 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Attribute + attr_accessor :dry_run + + attr_accessor :upsert + + attr_accessor :status + + attr_accessor :error_message + + attr_accessor :total_processed + + attr_accessor :total_rows + + attr_accessor :updated_valid + + attr_accessor :updated_no_email + + attr_accessor :updated_invalid + + attr_accessor :skipped_duplicate + + attr_accessor :skipped_invalid + + attr_accessor :skipped_multiple_matches + + attr_accessor :not_found + + attr_accessor :created_invalid + + attr_accessor :created_no_email + + attr_accessor :created_valid + + 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 + { + :'dry_run' => :'dryRun', + :'upsert' => :'upsert', + :'status' => :'status', + :'error_message' => :'errorMessage', + :'total_processed' => :'totalProcessed', + :'total_rows' => :'totalRows', + :'updated_valid' => :'updatedValid', + :'updated_no_email' => :'updatedNoEmail', + :'updated_invalid' => :'updatedInvalid', + :'skipped_duplicate' => :'skippedDuplicate', + :'skipped_invalid' => :'skippedInvalid', + :'skipped_multiple_matches' => :'skippedMultipleMatches', + :'not_found' => :'notFound', + :'created_invalid' => :'createdInvalid', + :'created_no_email' => :'createdNoEmail', + :'created_valid' => :'createdValid' + } + 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 + { + :'dry_run' => :'Boolean', + :'upsert' => :'Boolean', + :'status' => :'String', + :'error_message' => :'String', + :'total_processed' => :'Integer', + :'total_rows' => :'Integer', + :'updated_valid' => :'Integer', + :'updated_no_email' => :'Integer', + :'updated_invalid' => :'Integer', + :'skipped_duplicate' => :'Integer', + :'skipped_invalid' => :'Integer', + :'skipped_multiple_matches' => :'Integer', + :'not_found' => :'Integer', + :'created_invalid' => :'Integer', + :'created_no_email' => :'Integer', + :'created_valid' => :'Integer' + } + 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::A1099::V2::Attribute` 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::Attribute`. 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?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'upsert') + self.upsert = attributes[:'upsert'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'total_processed') + self.total_processed = attributes[:'total_processed'] + end + + if attributes.key?(:'total_rows') + self.total_rows = attributes[:'total_rows'] + end + + if attributes.key?(:'updated_valid') + self.updated_valid = attributes[:'updated_valid'] + end + + if attributes.key?(:'updated_no_email') + self.updated_no_email = attributes[:'updated_no_email'] + end + + if attributes.key?(:'updated_invalid') + self.updated_invalid = attributes[:'updated_invalid'] + end + + if attributes.key?(:'skipped_duplicate') + self.skipped_duplicate = attributes[:'skipped_duplicate'] + end + + if attributes.key?(:'skipped_invalid') + self.skipped_invalid = attributes[:'skipped_invalid'] + end + + if attributes.key?(:'skipped_multiple_matches') + self.skipped_multiple_matches = attributes[:'skipped_multiple_matches'] + end + + if attributes.key?(:'not_found') + self.not_found = attributes[:'not_found'] + end + + if attributes.key?(:'created_invalid') + self.created_invalid = attributes[:'created_invalid'] + end + + if attributes.key?(:'created_no_email') + self.created_no_email = attributes[:'created_no_email'] + end + + if attributes.key?(:'created_valid') + self.created_valid = attributes[:'created_valid'] + 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' + status_validator = EnumAttributeValidator.new('String', ["InProgress", "Success", "Failed"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["InProgress", "Success", "Failed"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + 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 && + dry_run == o.dry_run && + upsert == o.upsert && + status == o.status && + error_message == o.error_message && + total_processed == o.total_processed && + total_rows == o.total_rows && + updated_valid == o.updated_valid && + updated_no_email == o.updated_no_email && + updated_invalid == o.updated_invalid && + skipped_duplicate == o.skipped_duplicate && + skipped_invalid == o.skipped_invalid && + skipped_multiple_matches == o.skipped_multiple_matches && + not_found == o.not_found && + created_invalid == o.created_invalid && + created_no_email == o.created_no_email && + created_valid == o.created_valid + 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 + [dry_run, upsert, status, error_message, total_processed, total_rows, updated_valid, updated_no_email, updated_invalid, skipped_duplicate, skipped_invalid, skipped_multiple_matches, not_found, created_invalid, created_no_email, created_valid].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/authorized_api_request_model.rb b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb new file mode 100644 index 0000000..aef2341 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb @@ -0,0 +1,221 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class AuthorizedApiRequestModel + # The path and query of the API request you want to pre-authorize, omitting the leading /api/ + attr_accessor :path + + # Seconds until this AuthorizedApiRequest should expire, 3600 if omitted; values greater than 86400 will not be honored + attr_accessor :ttl + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'path' => :'path', + :'ttl' => :'ttl' + } + 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 + { + :'path' => :'String', + :'ttl' => :'Integer' + } + 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::A1099::V2::AuthorizedApiRequestModel` 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::AuthorizedApiRequestModel`. 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?(:'path') + self.path = attributes[:'path'] + end + + if attributes.key?(:'ttl') + self.ttl = attributes[:'ttl'] + 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 && + path == o.path && + ttl == o.ttl + 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 + [path, ttl].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/authorized_api_request_v2_data_model.rb b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb new file mode 100644 index 0000000..4c00190 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb @@ -0,0 +1,232 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # + class AuthorizedApiRequestV2DataModel + # + attr_accessor :id + + # + attr_accessor :path + + # + attr_accessor :expires_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'path' => :'path', + :'expires_at' => :'expiresAt' + } + 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', + :'path' => :'String', + :'expires_at' => :'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::A1099::V2::AuthorizedApiRequestV2DataModel` 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::AuthorizedApiRequestV2DataModel`. 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?(:'path') + self.path = attributes[:'path'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + 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 && + path == o.path && + expires_at == o.expires_at + 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, path, expires_at].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/base_company_model.rb b/lib/avalara_sdk/models/A1099/V2/base_company_model.rb new file mode 100644 index 0000000..6e9cfe5 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/base_company_model.rb @@ -0,0 +1,356 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class BaseCompanyModel + attr_accessor :name + + attr_accessor :email + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :telephone + + attr_accessor :tin + + attr_accessor :dba_name + + attr_accessor :reference_id + + attr_accessor :do_tin_match + + attr_accessor :group_name + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :resend_requests + + attr_accessor :resend_interval_days + + attr_accessor :max_reminder_attempts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'email' => :'email', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'telephone' => :'telephone', + :'tin' => :'tin', + :'dba_name' => :'dbaName', + :'reference_id' => :'referenceId', + :'do_tin_match' => :'doTinMatch', + :'group_name' => :'groupName', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'resend_requests' => :'resendRequests', + :'resend_interval_days' => :'resendIntervalDays', + :'max_reminder_attempts' => :'maxReminderAttempts' + } + 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', + :'email' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'telephone' => :'String', + :'tin' => :'String', + :'dba_name' => :'String', + :'reference_id' => :'String', + :'do_tin_match' => :'Boolean', + :'group_name' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'resend_requests' => :'Boolean', + :'resend_interval_days' => :'Integer', + :'max_reminder_attempts' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'resend_interval_days', + :'max_reminder_attempts' + ]) + 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::BaseCompanyModel` 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::BaseCompanyModel`. 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?(:'email') + self.email = attributes[:'email'] + 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?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'dba_name') + self.dba_name = attributes[:'dba_name'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'do_tin_match') + self.do_tin_match = attributes[:'do_tin_match'] + end + + if attributes.key?(:'group_name') + self.group_name = attributes[:'group_name'] + 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?(:'resend_requests') + self.resend_requests = attributes[:'resend_requests'] + end + + if attributes.key?(:'resend_interval_days') + self.resend_interval_days = attributes[:'resend_interval_days'] + end + + if attributes.key?(:'max_reminder_attempts') + self.max_reminder_attempts = attributes[:'max_reminder_attempts'] + 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 && + email == o.email && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + telephone == o.telephone && + tin == o.tin && + dba_name == o.dba_name && + reference_id == o.reference_id && + do_tin_match == o.do_tin_match && + group_name == o.group_name && + foreign_province == o.foreign_province && + country_code == o.country_code && + resend_requests == o.resend_requests && + resend_interval_days == o.resend_interval_days && + max_reminder_attempts == o.max_reminder_attempts + 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, email, address, city, state, zip, telephone, tin, dba_name, reference_id, do_tin_match, group_name, foreign_province, country_code, resend_requests, resend_interval_days, max_reminder_attempts].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/base_form_list_request.rb b/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb new file mode 100644 index 0000000..7ddd822 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb @@ -0,0 +1,210 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class BaseFormListRequest + attr_accessor :form_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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 + { + :'form_type' => :'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::A1099::V2::BaseFormListRequest` 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::BaseFormListRequest`. 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?(:'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 + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + 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 + [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/bulk_upsert1099_forms_request.rb b/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb new file mode 100644 index 0000000..a7717c2 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb @@ -0,0 +1,104 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module BulkUpsert1099FormsRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Form1099DivList', + :'Form1099KList', + :'Form1099MiscList', + :'Form1099NecList', + :'Form1099RList' + ] + 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/company_create_update_request_model.rb b/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb new file mode 100644 index 0000000..9bcb81b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb @@ -0,0 +1,363 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class CompanyCreateUpdateRequestModel + attr_accessor :name + + attr_accessor :email + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :telephone + + attr_accessor :tin + + attr_accessor :dba_name + + attr_accessor :reference_id + + attr_accessor :do_tin_match + + attr_accessor :group_name + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :resend_requests + + attr_accessor :resend_interval_days + + attr_accessor :max_reminder_attempts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'email' => :'email', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'telephone' => :'telephone', + :'tin' => :'tin', + :'dba_name' => :'dbaName', + :'reference_id' => :'referenceId', + :'do_tin_match' => :'doTinMatch', + :'group_name' => :'groupName', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'resend_requests' => :'resendRequests', + :'resend_interval_days' => :'resendIntervalDays', + :'max_reminder_attempts' => :'maxReminderAttempts' + } + 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', + :'email' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'telephone' => :'String', + :'tin' => :'String', + :'dba_name' => :'String', + :'reference_id' => :'String', + :'do_tin_match' => :'Boolean', + :'group_name' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'resend_requests' => :'Boolean', + :'resend_interval_days' => :'Integer', + :'max_reminder_attempts' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'resend_interval_days', + :'max_reminder_attempts' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BaseCompanyModel' + ] + 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::CompanyCreateUpdateRequestModel` 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::CompanyCreateUpdateRequestModel`. 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?(:'email') + self.email = attributes[:'email'] + 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?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'dba_name') + self.dba_name = attributes[:'dba_name'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'do_tin_match') + self.do_tin_match = attributes[:'do_tin_match'] + end + + if attributes.key?(:'group_name') + self.group_name = attributes[:'group_name'] + 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?(:'resend_requests') + self.resend_requests = attributes[:'resend_requests'] + end + + if attributes.key?(:'resend_interval_days') + self.resend_interval_days = attributes[:'resend_interval_days'] + end + + if attributes.key?(:'max_reminder_attempts') + self.max_reminder_attempts = attributes[:'max_reminder_attempts'] + 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 && + email == o.email && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + telephone == o.telephone && + tin == o.tin && + dba_name == o.dba_name && + reference_id == o.reference_id && + do_tin_match == o.do_tin_match && + group_name == o.group_name && + foreign_province == o.foreign_province && + country_code == o.country_code && + resend_requests == o.resend_requests && + resend_interval_days == o.resend_interval_days && + max_reminder_attempts == o.max_reminder_attempts + 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, email, address, city, state, zip, telephone, tin, dba_name, reference_id, do_tin_match, group_name, foreign_province, country_code, resend_requests, resend_interval_days, max_reminder_attempts].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/company_model.rb b/lib/avalara_sdk/models/A1099/V2/company_model.rb new file mode 100644 index 0000000..d6c0b07 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/company_model.rb @@ -0,0 +1,413 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class CompanyModel + # Company ID + attr_accessor :id + + # User ID associated with the company + attr_accessor :user_id + + # Account ID associated with the company + attr_accessor :account_id + + # Record creation timestamp + attr_accessor :created_at + + # Record last update timestamp + attr_accessor :updated_at + + attr_accessor :name + + attr_accessor :email + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :telephone + + attr_accessor :tin + + attr_accessor :dba_name + + attr_accessor :reference_id + + attr_accessor :do_tin_match + + attr_accessor :group_name + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :resend_requests + + attr_accessor :resend_interval_days + + attr_accessor :max_reminder_attempts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'user_id' => :'userId', + :'account_id' => :'accountId', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'name' => :'name', + :'email' => :'email', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'telephone' => :'telephone', + :'tin' => :'tin', + :'dba_name' => :'dbaName', + :'reference_id' => :'referenceId', + :'do_tin_match' => :'doTinMatch', + :'group_name' => :'groupName', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'resend_requests' => :'resendRequests', + :'resend_interval_days' => :'resendIntervalDays', + :'max_reminder_attempts' => :'maxReminderAttempts' + } + 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', + :'user_id' => :'Integer', + :'account_id' => :'Integer', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'name' => :'String', + :'email' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'telephone' => :'String', + :'tin' => :'String', + :'dba_name' => :'String', + :'reference_id' => :'String', + :'do_tin_match' => :'Boolean', + :'group_name' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'resend_requests' => :'Boolean', + :'resend_interval_days' => :'Integer', + :'max_reminder_attempts' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'resend_interval_days', + :'max_reminder_attempts' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BaseCompanyModel' + ] + 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::CompanyModel` 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::CompanyModel`. 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?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + 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?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'dba_name') + self.dba_name = attributes[:'dba_name'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'do_tin_match') + self.do_tin_match = attributes[:'do_tin_match'] + end + + if attributes.key?(:'group_name') + self.group_name = attributes[:'group_name'] + 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?(:'resend_requests') + self.resend_requests = attributes[:'resend_requests'] + end + + if attributes.key?(:'resend_interval_days') + self.resend_interval_days = attributes[:'resend_interval_days'] + end + + if attributes.key?(:'max_reminder_attempts') + self.max_reminder_attempts = attributes[:'max_reminder_attempts'] + 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 && + user_id == o.user_id && + account_id == o.account_id && + created_at == o.created_at && + updated_at == o.updated_at && + name == o.name && + email == o.email && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + telephone == o.telephone && + tin == o.tin && + dba_name == o.dba_name && + reference_id == o.reference_id && + do_tin_match == o.do_tin_match && + group_name == o.group_name && + foreign_province == o.foreign_province && + country_code == o.country_code && + resend_requests == o.resend_requests && + resend_interval_days == o.resend_interval_days && + max_reminder_attempts == o.max_reminder_attempts + 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, user_id, account_id, created_at, updated_at, name, email, address, city, state, zip, telephone, tin, dba_name, reference_id, do_tin_match, group_name, foreign_province, country_code, resend_requests, resend_interval_days, max_reminder_attempts].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/company_response.rb b/lib/avalara_sdk/models/A1099/V2/company_response.rb new file mode 100644 index 0000000..cf0a45c --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/company_response.rb @@ -0,0 +1,400 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class CompanyResponse + attr_accessor :id + + attr_accessor :reference_id + + attr_accessor :group_name + + attr_accessor :name + + attr_accessor :dba_name + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :foreign_province + + attr_accessor :zip + + attr_accessor :country_code + + attr_accessor :email + + attr_accessor :telephone + + attr_accessor :tin + + attr_accessor :do_tin_match + + attr_accessor :resend_requests + + attr_accessor :resend_interval_days + + attr_accessor :max_reminder_attempts + + attr_accessor :created_at + + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'reference_id' => :'referenceId', + :'group_name' => :'groupName', + :'name' => :'name', + :'dba_name' => :'dbaName', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'foreign_province' => :'foreignProvince', + :'zip' => :'zip', + :'country_code' => :'countryCode', + :'email' => :'email', + :'telephone' => :'telephone', + :'tin' => :'tin', + :'do_tin_match' => :'doTinMatch', + :'resend_requests' => :'resendRequests', + :'resend_interval_days' => :'resendIntervalDays', + :'max_reminder_attempts' => :'maxReminderAttempts', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'reference_id' => :'String', + :'group_name' => :'String', + :'name' => :'String', + :'dba_name' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'foreign_province' => :'String', + :'zip' => :'String', + :'country_code' => :'String', + :'email' => :'String', + :'telephone' => :'String', + :'tin' => :'String', + :'do_tin_match' => :'Boolean', + :'resend_requests' => :'Boolean', + :'resend_interval_days' => :'Integer', + :'max_reminder_attempts' => :'Integer', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'reference_id', + :'group_name', + :'name', + :'dba_name', + :'address', + :'city', + :'state', + :'foreign_province', + :'zip', + :'country_code', + :'email', + :'telephone', + :'tin', + :'do_tin_match', + :'resend_requests', + :'resend_interval_days', + :'max_reminder_attempts', + :'created_at', + :'updated_at' + ]) + 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::CompanyResponse` 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::CompanyResponse`. 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?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'group_name') + self.group_name = attributes[:'group_name'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'dba_name') + self.dba_name = attributes[:'dba_name'] + 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?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'do_tin_match') + self.do_tin_match = attributes[:'do_tin_match'] + end + + if attributes.key?(:'resend_requests') + self.resend_requests = attributes[:'resend_requests'] + end + + if attributes.key?(:'resend_interval_days') + self.resend_interval_days = attributes[:'resend_interval_days'] + end + + if attributes.key?(:'max_reminder_attempts') + self.max_reminder_attempts = attributes[:'max_reminder_attempts'] + 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 + 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 && + reference_id == o.reference_id && + group_name == o.group_name && + name == o.name && + dba_name == o.dba_name && + address == o.address && + city == o.city && + state == o.state && + foreign_province == o.foreign_province && + zip == o.zip && + country_code == o.country_code && + email == o.email && + telephone == o.telephone && + tin == o.tin && + do_tin_match == o.do_tin_match && + resend_requests == o.resend_requests && + resend_interval_days == o.resend_interval_days && + max_reminder_attempts == o.max_reminder_attempts && + created_at == o.created_at && + updated_at == o.updated_at + 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, reference_id, group_name, name, dba_name, address, city, state, foreign_province, zip, country_code, email, telephone, tin, do_tin_match, resend_requests, resend_interval_days, max_reminder_attempts, created_at, updated_at].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/company_response_model.rb b/lib/avalara_sdk/models/A1099/V2/company_response_model.rb new file mode 100644 index 0000000..b03c386 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/company_response_model.rb @@ -0,0 +1,390 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class CompanyResponseModel + attr_accessor :id + + attr_accessor :created_at + + attr_accessor :updated_at + + attr_accessor :name + + attr_accessor :email + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :telephone + + attr_accessor :tin + + attr_accessor :dba_name + + attr_accessor :reference_id + + attr_accessor :do_tin_match + + attr_accessor :group_name + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :resend_requests + + attr_accessor :resend_interval_days + + attr_accessor :max_reminder_attempts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'name' => :'name', + :'email' => :'email', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'telephone' => :'telephone', + :'tin' => :'tin', + :'dba_name' => :'dbaName', + :'reference_id' => :'referenceId', + :'do_tin_match' => :'doTinMatch', + :'group_name' => :'groupName', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'resend_requests' => :'resendRequests', + :'resend_interval_days' => :'resendIntervalDays', + :'max_reminder_attempts' => :'maxReminderAttempts' + } + 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', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'name' => :'String', + :'email' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'telephone' => :'String', + :'tin' => :'String', + :'dba_name' => :'String', + :'reference_id' => :'String', + :'do_tin_match' => :'Boolean', + :'group_name' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'resend_requests' => :'Boolean', + :'resend_interval_days' => :'Integer', + :'max_reminder_attempts' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'resend_interval_days', + :'max_reminder_attempts' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BaseCompanyModel' + ] + 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::CompanyResponseModel` 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::CompanyResponseModel`. 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + 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?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'dba_name') + self.dba_name = attributes[:'dba_name'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'do_tin_match') + self.do_tin_match = attributes[:'do_tin_match'] + end + + if attributes.key?(:'group_name') + self.group_name = attributes[:'group_name'] + 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?(:'resend_requests') + self.resend_requests = attributes[:'resend_requests'] + end + + if attributes.key?(:'resend_interval_days') + self.resend_interval_days = attributes[:'resend_interval_days'] + end + + if attributes.key?(:'max_reminder_attempts') + self.max_reminder_attempts = attributes[:'max_reminder_attempts'] + 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 && + created_at == o.created_at && + updated_at == o.updated_at && + name == o.name && + email == o.email && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + telephone == o.telephone && + tin == o.tin && + dba_name == o.dba_name && + reference_id == o.reference_id && + do_tin_match == o.do_tin_match && + group_name == o.group_name && + foreign_province == o.foreign_province && + country_code == o.country_code && + resend_requests == o.resend_requests && + resend_interval_days == o.resend_interval_days && + max_reminder_attempts == o.max_reminder_attempts + 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, created_at, updated_at, name, email, address, city, state, zip, telephone, tin, dba_name, reference_id, do_tin_match, group_name, foreign_province, country_code, resend_requests, resend_interval_days, max_reminder_attempts].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/data.rb b/lib/avalara_sdk/models/A1099/V2/data.rb new file mode 100644 index 0000000..1d40890 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/data.rb @@ -0,0 +1,237 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Data + attr_accessor :id + + attr_accessor :type + + attr_accessor :attributes + + attr_accessor :links + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'attributes' => :'attributes', + :'links' => :'links' + } + 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', + :'attributes' => :'Attribute', + :'links' => :'Link' + } + 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::A1099::V2::Data` 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::Data`. 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?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + 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 && + type == o.type && + attributes == o.attributes && + links == o.links + 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, attributes, links].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/error_model.rb b/lib/avalara_sdk/models/A1099/V2/error_model.rb new file mode 100644 index 0000000..17974d4 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/error_model.rb @@ -0,0 +1,263 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # Error model returned in response for all API errors + class ErrorModel + # HTTP error code in 4xx or 5xx. + attr_accessor :type + + # HTTP error code in 4xx or 5xx. + attr_accessor :status + + # Description of the HTTP error code. + attr_accessor :title + + # Detailed error message. + attr_accessor :detail + + # Error code. + attr_accessor :instance + + # Cause of error. + attr_accessor :source + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'status' => :'status', + :'title' => :'title', + :'detail' => :'detail', + :'instance' => :'instance', + :'source' => :'source' + } + 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', + :'status' => :'String', + :'title' => :'String', + :'detail' => :'String', + :'instance' => :'String', + :'source' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'source' + ]) + 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::ErrorModel` 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::ErrorModel`. 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?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + 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 && + type == o.type && + status == o.status && + title == o.title && + detail == o.detail && + instance == o.instance && + source == o.source + 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, status, title, detail, instance, source].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/error_response.rb b/lib/avalara_sdk/models/A1099/V2/error_response.rb new file mode 100644 index 0000000..6cd17ae --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/error_response.rb @@ -0,0 +1,229 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class ErrorResponse + attr_accessor :title + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'title' => :'title', + :'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 + { + :'title' => :'String', + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'title', + :'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::ErrorResponse` 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::ErrorResponse`. 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?(:'title') + self.title = attributes[:'title'] + 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 && + title == o.title && + 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 + [title, 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/error_response_errors_inner.rb b/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb new file mode 100644 index 0000000..8003cfd --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb @@ -0,0 +1,101 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module ErrorResponseErrorsInner + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HttpValidationProblemDetails', + :'ProblemDetails' + ] + 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_base.rb b/lib/avalara_sdk/models/A1099/V2/form1099_base.rb new file mode 100644 index 0000000..3846a8b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_base.rb @@ -0,0 +1,535 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099Base + attr_accessor :id + + attr_accessor :type + + attr_accessor :issuer_id + + attr_accessor :issuer_reference_id + + attr_accessor :issuer_tin + + attr_accessor :tax_year + + attr_accessor :federal_efile + + attr_accessor :federal_efile_status + + attr_accessor :state_efile + + attr_accessor :state_efile_status + + attr_accessor :postal_mail + + attr_accessor :postal_mail_status + + attr_accessor :tin_match + + attr_accessor :tin_match_status + + attr_accessor :address_verification + + attr_accessor :address_verification_status + + attr_accessor :reference_id + + attr_accessor :email + + attr_accessor :type_of_tin + + attr_accessor :tin + + attr_accessor :first_payee_name + + attr_accessor :second_payee_name + + attr_accessor :address + + attr_accessor :address_recipient_second + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :validation_errors + + attr_accessor :created_at + + 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', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'first_payee_name' => :'firstPayeeName', + :'second_payee_name' => :'secondPayeeName', + :'address' => :'address', + :'address_recipient_second' => :'addressRecipientSecond', + :'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' => :'Form1099StatusDetail', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetail', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetail', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetail', + :'reference_id' => :'String', + :'email' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'first_payee_name' => :'String', + :'second_payee_name' => :'String', + :'address' => :'String', + :'address_recipient_second' => :'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' => :'StateAndLocalWithholding' + } + 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', + :'type_of_tin', + :'tin', + :'first_payee_name', + :'second_payee_name', + :'address', + :'address_recipient_second', + :'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::Form1099Base` 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::Form1099Base`. 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?(:'type') + self.type = attributes[:'type'] + 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?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + 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'] + 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'] + 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'] + 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'] + 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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'first_payee_name') + self.first_payee_name = attributes[:'first_payee_name'] + end + + if attributes.key?(:'second_payee_name') + self.second_payee_name = attributes[:'second_payee_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address_recipient_second') + self.address_recipient_second = attributes[:'address_recipient_second'] + 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 + 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] 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 && + type_of_tin == o.type_of_tin && + tin == o.tin && + first_payee_name == o.first_payee_name && + second_payee_name == o.second_payee_name && + address == o.address && + address_recipient_second == o.address_recipient_second && + 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, type_of_tin, tin, first_payee_name, second_payee_name, address, address_recipient_second, 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 new file mode 100644 index 0000000..91c28ea --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb @@ -0,0 +1,238 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099DivList + 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::Form1099DivList` 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::Form1099DivList`. 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/form1099_div_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb new file mode 100644 index 0000000..6ef9eac --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb @@ -0,0 +1,604 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099DivListItem + attr_accessor :total_ordinary_dividends + + attr_accessor :qualified_dividends + + attr_accessor :total_capital_gain_distr + + attr_accessor :unrecap_sec1250_gain + + attr_accessor :section1202_gain + + attr_accessor :collectibles_gain + + attr_accessor :section897_ordinary_dividends + + attr_accessor :section897_capital_gain + + attr_accessor :nondividend_distributions + + attr_accessor :federal_income_tax_withheld + + attr_accessor :section199_a_dividends + + attr_accessor :investment_expenses + + attr_accessor :foreign_tax_paid + + attr_accessor :foreign_country_or_us_possession + + attr_accessor :cash_liquidation_distributions + + attr_accessor :noncash_liquidation_distributions + + attr_accessor :exempt_interest_dividends + + attr_accessor :specified_private_activity_bond_interest_dividends + + attr_accessor :fatca_filing_requirement + + attr_accessor :state_and_local_withholding + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total_ordinary_dividends' => :'totalOrdinaryDividends', + :'qualified_dividends' => :'qualifiedDividends', + :'total_capital_gain_distr' => :'totalCapitalGainDistr', + :'unrecap_sec1250_gain' => :'unrecapSec1250Gain', + :'section1202_gain' => :'section1202Gain', + :'collectibles_gain' => :'collectiblesGain', + :'section897_ordinary_dividends' => :'section897OrdinaryDividends', + :'section897_capital_gain' => :'section897CapitalGain', + :'nondividend_distributions' => :'nondividendDistributions', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'section199_a_dividends' => :'section199ADividends', + :'investment_expenses' => :'investmentExpenses', + :'foreign_tax_paid' => :'foreignTaxPaid', + :'foreign_country_or_us_possession' => :'foreignCountryOrUSPossession', + :'cash_liquidation_distributions' => :'cashLiquidationDistributions', + :'noncash_liquidation_distributions' => :'noncashLiquidationDistributions', + :'exempt_interest_dividends' => :'exemptInterestDividends', + :'specified_private_activity_bond_interest_dividends' => :'specifiedPrivateActivityBondInterestDividends', + :'fatca_filing_requirement' => :'fatcaFilingRequirement', + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'total_ordinary_dividends' => :'String', + :'qualified_dividends' => :'String', + :'total_capital_gain_distr' => :'String', + :'unrecap_sec1250_gain' => :'String', + :'section1202_gain' => :'String', + :'collectibles_gain' => :'String', + :'section897_ordinary_dividends' => :'String', + :'section897_capital_gain' => :'String', + :'nondividend_distributions' => :'String', + :'federal_income_tax_withheld' => :'String', + :'section199_a_dividends' => :'String', + :'investment_expenses' => :'String', + :'foreign_tax_paid' => :'String', + :'foreign_country_or_us_possession' => :'String', + :'cash_liquidation_distributions' => :'String', + :'noncash_liquidation_distributions' => :'String', + :'exempt_interest_dividends' => :'String', + :'specified_private_activity_bond_interest_dividends' => :'String', + :'fatca_filing_requirement' => :'String', + :'state_and_local_withholding' => :'StateAndLocalWithholding', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099DivListItem` 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::Form1099DivListItem`. 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?(:'total_ordinary_dividends') + self.total_ordinary_dividends = attributes[:'total_ordinary_dividends'] + end + + if attributes.key?(:'qualified_dividends') + self.qualified_dividends = attributes[:'qualified_dividends'] + end + + if attributes.key?(:'total_capital_gain_distr') + self.total_capital_gain_distr = attributes[:'total_capital_gain_distr'] + end + + if attributes.key?(:'unrecap_sec1250_gain') + self.unrecap_sec1250_gain = attributes[:'unrecap_sec1250_gain'] + end + + if attributes.key?(:'section1202_gain') + self.section1202_gain = attributes[:'section1202_gain'] + end + + if attributes.key?(:'collectibles_gain') + self.collectibles_gain = attributes[:'collectibles_gain'] + end + + if attributes.key?(:'section897_ordinary_dividends') + self.section897_ordinary_dividends = attributes[:'section897_ordinary_dividends'] + end + + if attributes.key?(:'section897_capital_gain') + self.section897_capital_gain = attributes[:'section897_capital_gain'] + end + + if attributes.key?(:'nondividend_distributions') + self.nondividend_distributions = attributes[:'nondividend_distributions'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + end + + if attributes.key?(:'section199_a_dividends') + self.section199_a_dividends = attributes[:'section199_a_dividends'] + end + + if attributes.key?(:'investment_expenses') + self.investment_expenses = attributes[:'investment_expenses'] + end + + if attributes.key?(:'foreign_tax_paid') + self.foreign_tax_paid = attributes[:'foreign_tax_paid'] + end + + if attributes.key?(:'foreign_country_or_us_possession') + self.foreign_country_or_us_possession = attributes[:'foreign_country_or_us_possession'] + end + + if attributes.key?(:'cash_liquidation_distributions') + self.cash_liquidation_distributions = attributes[:'cash_liquidation_distributions'] + end + + if attributes.key?(:'noncash_liquidation_distributions') + self.noncash_liquidation_distributions = attributes[:'noncash_liquidation_distributions'] + end + + if attributes.key?(:'exempt_interest_dividends') + self.exempt_interest_dividends = attributes[:'exempt_interest_dividends'] + end + + if attributes.key?(:'specified_private_activity_bond_interest_dividends') + self.specified_private_activity_bond_interest_dividends = attributes[:'specified_private_activity_bond_interest_dividends'] + end + + if attributes.key?(:'fatca_filing_requirement') + self.fatca_filing_requirement = attributes[:'fatca_filing_requirement'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + 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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + total_ordinary_dividends == o.total_ordinary_dividends && + qualified_dividends == o.qualified_dividends && + total_capital_gain_distr == o.total_capital_gain_distr && + unrecap_sec1250_gain == o.unrecap_sec1250_gain && + section1202_gain == o.section1202_gain && + collectibles_gain == o.collectibles_gain && + section897_ordinary_dividends == o.section897_ordinary_dividends && + section897_capital_gain == o.section897_capital_gain && + nondividend_distributions == o.nondividend_distributions && + federal_income_tax_withheld == o.federal_income_tax_withheld && + section199_a_dividends == o.section199_a_dividends && + investment_expenses == o.investment_expenses && + foreign_tax_paid == o.foreign_tax_paid && + foreign_country_or_us_possession == o.foreign_country_or_us_possession && + cash_liquidation_distributions == o.cash_liquidation_distributions && + noncash_liquidation_distributions == o.noncash_liquidation_distributions && + exempt_interest_dividends == o.exempt_interest_dividends && + specified_private_activity_bond_interest_dividends == o.specified_private_activity_bond_interest_dividends && + fatca_filing_requirement == o.fatca_filing_requirement && + state_and_local_withholding == o.state_and_local_withholding && + 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 && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [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, state_and_local_withholding, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_div_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb new file mode 100644 index 0000000..284f211 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb @@ -0,0 +1,613 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099DivRequest + attr_accessor :total_ordinary_dividends + + attr_accessor :qualified_dividends + + attr_accessor :total_capital_gain_distr + + attr_accessor :unrecap_sec1250_gain + + attr_accessor :section1202_gain + + attr_accessor :collectibles_gain + + attr_accessor :section897_ordinary_dividends + + attr_accessor :section897_capital_gain + + attr_accessor :nondividend_distributions + + attr_accessor :federal_income_tax_withheld + + attr_accessor :section199_a_dividends + + attr_accessor :investment_expenses + + attr_accessor :foreign_tax_paid + + attr_accessor :foreign_country_or_us_possession + + attr_accessor :cash_liquidation_distributions + + attr_accessor :noncash_liquidation_distributions + + attr_accessor :exempt_interest_dividends + + attr_accessor :specified_private_activity_bond_interest_dividends + + attr_accessor :fatca_filing_requirement + + attr_accessor :state_and_local_withholding + + attr_accessor :type + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'total_ordinary_dividends' => :'totalOrdinaryDividends', + :'qualified_dividends' => :'qualifiedDividends', + :'total_capital_gain_distr' => :'totalCapitalGainDistr', + :'unrecap_sec1250_gain' => :'unrecapSec1250Gain', + :'section1202_gain' => :'section1202Gain', + :'collectibles_gain' => :'collectiblesGain', + :'section897_ordinary_dividends' => :'section897OrdinaryDividends', + :'section897_capital_gain' => :'section897CapitalGain', + :'nondividend_distributions' => :'nondividendDistributions', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'section199_a_dividends' => :'section199ADividends', + :'investment_expenses' => :'investmentExpenses', + :'foreign_tax_paid' => :'foreignTaxPaid', + :'foreign_country_or_us_possession' => :'foreignCountryOrUSPossession', + :'cash_liquidation_distributions' => :'cashLiquidationDistributions', + :'noncash_liquidation_distributions' => :'noncashLiquidationDistributions', + :'exempt_interest_dividends' => :'exemptInterestDividends', + :'specified_private_activity_bond_interest_dividends' => :'specifiedPrivateActivityBondInterestDividends', + :'fatca_filing_requirement' => :'fatcaFilingRequirement', + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'total_ordinary_dividends' => :'String', + :'qualified_dividends' => :'String', + :'total_capital_gain_distr' => :'String', + :'unrecap_sec1250_gain' => :'String', + :'section1202_gain' => :'String', + :'collectibles_gain' => :'String', + :'section897_ordinary_dividends' => :'String', + :'section897_capital_gain' => :'String', + :'nondividend_distributions' => :'String', + :'federal_income_tax_withheld' => :'String', + :'section199_a_dividends' => :'String', + :'investment_expenses' => :'String', + :'foreign_tax_paid' => :'String', + :'foreign_country_or_us_possession' => :'String', + :'cash_liquidation_distributions' => :'String', + :'noncash_liquidation_distributions' => :'String', + :'exempt_interest_dividends' => :'String', + :'specified_private_activity_bond_interest_dividends' => :'String', + :'fatca_filing_requirement' => :'String', + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest', + :'type' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099DivRequest` 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::Form1099DivRequest`. 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?(:'total_ordinary_dividends') + self.total_ordinary_dividends = attributes[:'total_ordinary_dividends'] + end + + if attributes.key?(:'qualified_dividends') + self.qualified_dividends = attributes[:'qualified_dividends'] + end + + if attributes.key?(:'total_capital_gain_distr') + self.total_capital_gain_distr = attributes[:'total_capital_gain_distr'] + end + + if attributes.key?(:'unrecap_sec1250_gain') + self.unrecap_sec1250_gain = attributes[:'unrecap_sec1250_gain'] + end + + if attributes.key?(:'section1202_gain') + self.section1202_gain = attributes[:'section1202_gain'] + end + + if attributes.key?(:'collectibles_gain') + self.collectibles_gain = attributes[:'collectibles_gain'] + end + + if attributes.key?(:'section897_ordinary_dividends') + self.section897_ordinary_dividends = attributes[:'section897_ordinary_dividends'] + end + + if attributes.key?(:'section897_capital_gain') + self.section897_capital_gain = attributes[:'section897_capital_gain'] + end + + if attributes.key?(:'nondividend_distributions') + self.nondividend_distributions = attributes[:'nondividend_distributions'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + end + + if attributes.key?(:'section199_a_dividends') + self.section199_a_dividends = attributes[:'section199_a_dividends'] + end + + if attributes.key?(:'investment_expenses') + self.investment_expenses = attributes[:'investment_expenses'] + end + + if attributes.key?(:'foreign_tax_paid') + self.foreign_tax_paid = attributes[:'foreign_tax_paid'] + end + + if attributes.key?(:'foreign_country_or_us_possession') + self.foreign_country_or_us_possession = attributes[:'foreign_country_or_us_possession'] + end + + if attributes.key?(:'cash_liquidation_distributions') + self.cash_liquidation_distributions = attributes[:'cash_liquidation_distributions'] + end + + if attributes.key?(:'noncash_liquidation_distributions') + self.noncash_liquidation_distributions = attributes[:'noncash_liquidation_distributions'] + end + + if attributes.key?(:'exempt_interest_dividends') + self.exempt_interest_dividends = attributes[:'exempt_interest_dividends'] + end + + if attributes.key?(:'specified_private_activity_bond_interest_dividends') + self.specified_private_activity_bond_interest_dividends = attributes[:'specified_private_activity_bond_interest_dividends'] + end + + if attributes.key?(:'fatca_filing_requirement') + self.fatca_filing_requirement = attributes[:'fatca_filing_requirement'] + 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?(:'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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + total_ordinary_dividends == o.total_ordinary_dividends && + qualified_dividends == o.qualified_dividends && + total_capital_gain_distr == o.total_capital_gain_distr && + unrecap_sec1250_gain == o.unrecap_sec1250_gain && + section1202_gain == o.section1202_gain && + collectibles_gain == o.collectibles_gain && + section897_ordinary_dividends == o.section897_ordinary_dividends && + section897_capital_gain == o.section897_capital_gain && + nondividend_distributions == o.nondividend_distributions && + federal_income_tax_withheld == o.federal_income_tax_withheld && + section199_a_dividends == o.section199_a_dividends && + investment_expenses == o.investment_expenses && + foreign_tax_paid == o.foreign_tax_paid && + foreign_country_or_us_possession == o.foreign_country_or_us_possession && + cash_liquidation_distributions == o.cash_liquidation_distributions && + noncash_liquidation_distributions == o.noncash_liquidation_distributions && + exempt_interest_dividends == o.exempt_interest_dividends && + specified_private_activity_bond_interest_dividends == o.specified_private_activity_bond_interest_dividends && + fatca_filing_requirement == o.fatca_filing_requirement && + state_and_local_withholding == o.state_and_local_withholding && + 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 && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [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, state_and_local_withholding, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_k.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k.rb new file mode 100644 index 0000000..67f474a --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k.rb @@ -0,0 +1,784 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099K + attr_accessor :filer_type + + attr_accessor :payment_type + + attr_accessor :payment_settlement_entity_name_phone_number + + attr_accessor :gross_amount_payment_card + + attr_accessor :card_not_present_transactions + + attr_accessor :merchant_category_code + + attr_accessor :payment_transaction_number + + attr_accessor :federal_income_tax_withheld + + attr_accessor :january + + attr_accessor :february + + attr_accessor :march + + attr_accessor :april + + attr_accessor :may + + attr_accessor :june + + attr_accessor :july + + attr_accessor :august + + attr_accessor :sept + + attr_accessor :october + + attr_accessor :november + + attr_accessor :december + + attr_accessor :id + + attr_accessor :type + + attr_accessor :issuer_id + + attr_accessor :issuer_reference_id + + attr_accessor :issuer_tin + + attr_accessor :tax_year + + attr_accessor :federal_efile + + attr_accessor :federal_efile_status + + attr_accessor :state_efile + + attr_accessor :state_efile_status + + attr_accessor :postal_mail + + attr_accessor :postal_mail_status + + attr_accessor :tin_match + + attr_accessor :tin_match_status + + attr_accessor :address_verification + + attr_accessor :address_verification_status + + attr_accessor :reference_id + + attr_accessor :email + + attr_accessor :type_of_tin + + attr_accessor :tin + + attr_accessor :first_payee_name + + attr_accessor :second_payee_name + + attr_accessor :address + + attr_accessor :address_recipient_second + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :validation_errors + + attr_accessor :created_at + + 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', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'first_payee_name' => :'firstPayeeName', + :'second_payee_name' => :'secondPayeeName', + :'address' => :'address', + :'address_recipient_second' => :'addressRecipientSecond', + :'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' => :'Form1099StatusDetail', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetail', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetail', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetail', + :'reference_id' => :'String', + :'email' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'first_payee_name' => :'String', + :'second_payee_name' => :'String', + :'address' => :'String', + :'address_recipient_second' => :'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' => :'StateAndLocalWithholding' + } + 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', + :'type_of_tin', + :'tin', + :'first_payee_name', + :'second_payee_name', + :'address', + :'address_recipient_second', + :'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 + [ + :'Form1099Base' + ] + 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::Form1099K` 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::Form1099K`. 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'] + 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?(:'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'] + 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'] + 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'] + 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'] + 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'] + 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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'first_payee_name') + self.first_payee_name = attributes[:'first_payee_name'] + end + + if attributes.key?(:'second_payee_name') + self.second_payee_name = attributes[:'second_payee_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address_recipient_second') + self.address_recipient_second = attributes[:'address_recipient_second'] + 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 + 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) + 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] 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 && + type_of_tin == o.type_of_tin && + tin == o.tin && + first_payee_name == o.first_payee_name && + second_payee_name == o.second_payee_name && + address == o.address && + address_recipient_second == o.address_recipient_second && + 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, type_of_tin, tin, first_payee_name, second_payee_name, address, address_recipient_second, 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_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb new file mode 100644 index 0000000..9820cf4 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb @@ -0,0 +1,238 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099KList + 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::Form1099KList` 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::Form1099KList`. 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/form1099_k_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb new file mode 100644 index 0000000..191b395 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb @@ -0,0 +1,676 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099KListItem + attr_accessor :state_and_local_withholding + + attr_accessor :filer_type + + attr_accessor :payment_type + + attr_accessor :payment_settlement_entity_name_phone_number + + attr_accessor :gross_amount_payment_card + + attr_accessor :card_not_present_transactions + + attr_accessor :merchant_category_code + + attr_accessor :payment_transaction_number + + attr_accessor :federal_income_tax_withheld + + attr_accessor :january + + attr_accessor :february + + attr_accessor :march + + attr_accessor :april + + attr_accessor :may + + attr_accessor :june + + attr_accessor :july + + attr_accessor :august + + attr_accessor :sept + + attr_accessor :october + + attr_accessor :november + + attr_accessor :december + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + 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 + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'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', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholding', + :'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', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + :'state_and_local_withholding', + :'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', + ]) + 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::Form1099KListItem` 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::Form1099KListItem`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + 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?(:'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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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' + 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) + 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 + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + state_and_local_withholding == o.state_and_local_withholding && + 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 && + 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 && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, 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_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_k_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb new file mode 100644 index 0000000..2d21e2b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb @@ -0,0 +1,639 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099KRequest + attr_accessor :state_and_local_withholding + + attr_accessor :filer_type + + attr_accessor :payment_type + + attr_accessor :payment_settlement_entity_name_phone_number + + attr_accessor :gross_amount_payment_card + + attr_accessor :card_not_present_transactions + + attr_accessor :merchant_category_code + + attr_accessor :payment_transaction_number + + attr_accessor :federal_income_tax_withheld + + attr_accessor :january + + attr_accessor :february + + attr_accessor :march + + attr_accessor :april + + attr_accessor :may + + attr_accessor :june + + attr_accessor :july + + attr_accessor :august + + attr_accessor :sept + + attr_accessor :october + + attr_accessor :november + + attr_accessor :december + + attr_accessor :type + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'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', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholding', + :'filer_type' => :'Integer', + :'payment_type' => :'Integer', + :'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', + :'type' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + :'state_and_local_withholding', + :'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', + ]) + 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::Form1099KRequest` 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::Form1099KRequest`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + 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?(:'type') + self.type = attributes[:'type'] + 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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + state_and_local_withholding == o.state_and_local_withholding && + 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 && + 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 && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, 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, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_list.rb new file mode 100644 index 0000000..caa01a5 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_list.rb @@ -0,0 +1,219 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099List + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + 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 + { + :'data' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'data' + ]) + 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::Form1099List` 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::Form1099List`. 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?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = 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] data Value to be assigned + def data=(data) + @data = data + 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 && + data == o.data + 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 + [data].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_data_inner.rb b/lib/avalara_sdk/models/A1099/V2/form1099_list_data_inner.rb new file mode 100644 index 0000000..ecd0e16 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_list_data_inner.rb @@ -0,0 +1,103 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module Form1099ListDataInner + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Form1099K', + :'Form1099Misc', + :'Form1099Nec', + :'Form1099R' + ] + 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.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc.rb new file mode 100644 index 0000000..3e1d580 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc.rb @@ -0,0 +1,681 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099Misc + attr_accessor :rents + + attr_accessor :royalties + + attr_accessor :other_income + + attr_accessor :fed_income_tax_withheld + + attr_accessor :fishing_boat_proceeds + + attr_accessor :medical_and_health_care + + attr_accessor :nonemployee_compensation + + attr_accessor :substitute_payments + + attr_accessor :direct_sales_indicator + + attr_accessor :crop_insurance_proceeds + + attr_accessor :excess_golden_parachute + + attr_accessor :gross_amount_paid_attorney + + attr_accessor :section409_a_deferrals + + attr_accessor :section409_a_income + + attr_accessor :id + + attr_accessor :type + + attr_accessor :issuer_id + + attr_accessor :issuer_reference_id + + attr_accessor :issuer_tin + + attr_accessor :tax_year + + attr_accessor :federal_efile + + attr_accessor :federal_efile_status + + attr_accessor :state_efile + + attr_accessor :state_efile_status + + attr_accessor :postal_mail + + attr_accessor :postal_mail_status + + attr_accessor :tin_match + + attr_accessor :tin_match_status + + attr_accessor :address_verification + + attr_accessor :address_verification_status + + attr_accessor :reference_id + + attr_accessor :email + + attr_accessor :type_of_tin + + attr_accessor :tin + + attr_accessor :first_payee_name + + attr_accessor :second_payee_name + + attr_accessor :address + + attr_accessor :address_recipient_second + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :validation_errors + + attr_accessor :created_at + + 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', + :'nonemployee_compensation' => :'nonemployeeCompensation', + :'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', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'first_payee_name' => :'firstPayeeName', + :'second_payee_name' => :'secondPayeeName', + :'address' => :'address', + :'address_recipient_second' => :'addressRecipientSecond', + :'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', + :'nonemployee_compensation' => :'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' => :'Form1099StatusDetail', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetail', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetail', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetail', + :'reference_id' => :'String', + :'email' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'first_payee_name' => :'String', + :'second_payee_name' => :'String', + :'address' => :'String', + :'address_recipient_second' => :'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' => :'StateAndLocalWithholding' + } + 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', + :'nonemployee_compensation', + :'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', + :'type_of_tin', + :'tin', + :'first_payee_name', + :'second_payee_name', + :'address', + :'address_recipient_second', + :'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 + [ + :'Form1099Base' + ] + 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::Form1099Misc` 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::Form1099Misc`. 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?(:'nonemployee_compensation') + self.nonemployee_compensation = attributes[:'nonemployee_compensation'] + 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'] + 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?(:'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'] + 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'] + 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'] + 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'] + 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'] + 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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'first_payee_name') + self.first_payee_name = attributes[:'first_payee_name'] + end + + if attributes.key?(:'second_payee_name') + self.second_payee_name = attributes[:'second_payee_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address_recipient_second') + self.address_recipient_second = attributes[:'address_recipient_second'] + 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 + 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] 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 && + nonemployee_compensation == o.nonemployee_compensation && + 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 && + type_of_tin == o.type_of_tin && + tin == o.tin && + first_payee_name == o.first_payee_name && + second_payee_name == o.second_payee_name && + address == o.address && + address_recipient_second == o.address_recipient_second && + 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, nonemployee_compensation, 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, type_of_tin, tin, first_payee_name, second_payee_name, address, address_recipient_second, 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_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb new file mode 100644 index 0000000..b56b700 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb @@ -0,0 +1,238 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099MiscList + 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::Form1099MiscList` 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::Form1099MiscList`. 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/form1099_misc_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb new file mode 100644 index 0000000..1e663e3 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb @@ -0,0 +1,577 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099MiscListItem + attr_accessor :state_and_local_withholding + + attr_accessor :second_tin_notice + + attr_accessor :rents + + attr_accessor :royalties + + attr_accessor :other_income + + attr_accessor :fed_income_tax_withheld + + attr_accessor :fishing_boat_proceeds + + attr_accessor :medical_health_care_payments + + attr_accessor :payer_made_direct_sales + + attr_accessor :substitute_payments + + attr_accessor :crop_insurance_proceeds + + attr_accessor :gross_proceeds_paid_to_attorney + + attr_accessor :fish_purchased_for_resale + + attr_accessor :section409_a_deferrals + + attr_accessor :fatca_filing_requirement + + attr_accessor :excess_golden_parachute_payments + + attr_accessor :nonqualified_deferred_compensation + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'second_tin_notice' => :'secondTinNotice', + :'rents' => :'rents', + :'royalties' => :'royalties', + :'other_income' => :'otherIncome', + :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', + :'fishing_boat_proceeds' => :'fishingBoatProceeds', + :'medical_health_care_payments' => :'medicalHealthCarePayments', + :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'substitute_payments' => :'substitutePayments', + :'crop_insurance_proceeds' => :'cropInsuranceProceeds', + :'gross_proceeds_paid_to_attorney' => :'grossProceedsPaidToAttorney', + :'fish_purchased_for_resale' => :'fishPurchasedForResale', + :'section409_a_deferrals' => :'section409ADeferrals', + :'fatca_filing_requirement' => :'fatcaFilingRequirement', + :'excess_golden_parachute_payments' => :'excessGoldenParachutePayments', + :'nonqualified_deferred_compensation' => :'nonqualifiedDeferredCompensation', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholding', + :'second_tin_notice' => :'Boolean', + :'rents' => :'Float', + :'royalties' => :'Float', + :'other_income' => :'Float', + :'fed_income_tax_withheld' => :'Float', + :'fishing_boat_proceeds' => :'Float', + :'medical_health_care_payments' => :'Float', + :'payer_made_direct_sales' => :'Boolean', + :'substitute_payments' => :'Float', + :'crop_insurance_proceeds' => :'Float', + :'gross_proceeds_paid_to_attorney' => :'Float', + :'fish_purchased_for_resale' => :'Float', + :'section409_a_deferrals' => :'Float', + :'fatca_filing_requirement' => :'Boolean', + :'excess_golden_parachute_payments' => :'Float', + :'nonqualified_deferred_compensation' => :'Float', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099MiscListItem` 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::Form1099MiscListItem`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'second_tin_notice') + self.second_tin_notice = attributes[:'second_tin_notice'] + end + + 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_health_care_payments') + 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'] + end + + if attributes.key?(:'substitute_payments') + self.substitute_payments = attributes[:'substitute_payments'] + end + + if attributes.key?(:'crop_insurance_proceeds') + self.crop_insurance_proceeds = attributes[:'crop_insurance_proceeds'] + end + + if attributes.key?(:'gross_proceeds_paid_to_attorney') + self.gross_proceeds_paid_to_attorney = attributes[:'gross_proceeds_paid_to_attorney'] + end + + if attributes.key?(:'fish_purchased_for_resale') + self.fish_purchased_for_resale = attributes[:'fish_purchased_for_resale'] + end + + if attributes.key?(:'section409_a_deferrals') + self.section409_a_deferrals = attributes[:'section409_a_deferrals'] + end + + if attributes.key?(:'fatca_filing_requirement') + self.fatca_filing_requirement = attributes[:'fatca_filing_requirement'] + end + + if attributes.key?(:'excess_golden_parachute_payments') + self.excess_golden_parachute_payments = attributes[:'excess_golden_parachute_payments'] + end + + if attributes.key?(:'nonqualified_deferred_compensation') + self.nonqualified_deferred_compensation = attributes[:'nonqualified_deferred_compensation'] + 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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + state_and_local_withholding == o.state_and_local_withholding && + second_tin_notice == o.second_tin_notice && + 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_health_care_payments == o.medical_health_care_payments && + payer_made_direct_sales == o.payer_made_direct_sales && + substitute_payments == o.substitute_payments && + crop_insurance_proceeds == o.crop_insurance_proceeds && + gross_proceeds_paid_to_attorney == o.gross_proceeds_paid_to_attorney && + fish_purchased_for_resale == o.fish_purchased_for_resale && + section409_a_deferrals == o.section409_a_deferrals && + fatca_filing_requirement == o.fatca_filing_requirement && + excess_golden_parachute_payments == o.excess_golden_parachute_payments && + nonqualified_deferred_compensation == o.nonqualified_deferred_compensation && + 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 && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, 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_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_misc_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb new file mode 100644 index 0000000..fef1675 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb @@ -0,0 +1,586 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099MiscRequest + attr_accessor :state_and_local_withholding + + attr_accessor :second_tin_notice + + attr_accessor :rents + + attr_accessor :royalties + + attr_accessor :other_income + + attr_accessor :fed_income_tax_withheld + + attr_accessor :fishing_boat_proceeds + + attr_accessor :medical_health_care_payments + + attr_accessor :payer_made_direct_sales + + attr_accessor :substitute_payments + + attr_accessor :crop_insurance_proceeds + + attr_accessor :gross_proceeds_paid_to_attorney + + attr_accessor :fish_purchased_for_resale + + attr_accessor :section409_a_deferrals + + attr_accessor :fatca_filing_requirement + + attr_accessor :excess_golden_parachute_payments + + attr_accessor :nonqualified_deferred_compensation + + attr_accessor :type + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'second_tin_notice' => :'secondTinNotice', + :'rents' => :'rents', + :'royalties' => :'royalties', + :'other_income' => :'otherIncome', + :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', + :'fishing_boat_proceeds' => :'fishingBoatProceeds', + :'medical_health_care_payments' => :'medicalHealthCarePayments', + :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'substitute_payments' => :'substitutePayments', + :'crop_insurance_proceeds' => :'cropInsuranceProceeds', + :'gross_proceeds_paid_to_attorney' => :'grossProceedsPaidToAttorney', + :'fish_purchased_for_resale' => :'fishPurchasedForResale', + :'section409_a_deferrals' => :'section409ADeferrals', + :'fatca_filing_requirement' => :'fatcaFilingRequirement', + :'excess_golden_parachute_payments' => :'excessGoldenParachutePayments', + :'nonqualified_deferred_compensation' => :'nonqualifiedDeferredCompensation', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest', + :'second_tin_notice' => :'Boolean', + :'rents' => :'Float', + :'royalties' => :'Float', + :'other_income' => :'Float', + :'fed_income_tax_withheld' => :'Float', + :'fishing_boat_proceeds' => :'Float', + :'medical_health_care_payments' => :'Float', + :'payer_made_direct_sales' => :'Boolean', + :'substitute_payments' => :'Float', + :'crop_insurance_proceeds' => :'Float', + :'gross_proceeds_paid_to_attorney' => :'Float', + :'fish_purchased_for_resale' => :'Float', + :'section409_a_deferrals' => :'Float', + :'fatca_filing_requirement' => :'Boolean', + :'excess_golden_parachute_payments' => :'Float', + :'nonqualified_deferred_compensation' => :'Float', + :'type' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099MiscRequest` 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::Form1099MiscRequest`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'second_tin_notice') + self.second_tin_notice = attributes[:'second_tin_notice'] + end + + 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_health_care_payments') + 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'] + end + + if attributes.key?(:'substitute_payments') + self.substitute_payments = attributes[:'substitute_payments'] + end + + if attributes.key?(:'crop_insurance_proceeds') + self.crop_insurance_proceeds = attributes[:'crop_insurance_proceeds'] + end + + if attributes.key?(:'gross_proceeds_paid_to_attorney') + self.gross_proceeds_paid_to_attorney = attributes[:'gross_proceeds_paid_to_attorney'] + end + + if attributes.key?(:'fish_purchased_for_resale') + self.fish_purchased_for_resale = attributes[:'fish_purchased_for_resale'] + end + + if attributes.key?(:'section409_a_deferrals') + self.section409_a_deferrals = attributes[:'section409_a_deferrals'] + end + + if attributes.key?(:'fatca_filing_requirement') + self.fatca_filing_requirement = attributes[:'fatca_filing_requirement'] + end + + if attributes.key?(:'excess_golden_parachute_payments') + self.excess_golden_parachute_payments = attributes[:'excess_golden_parachute_payments'] + end + + if attributes.key?(:'nonqualified_deferred_compensation') + self.nonqualified_deferred_compensation = attributes[:'nonqualified_deferred_compensation'] + 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?(:'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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + state_and_local_withholding == o.state_and_local_withholding && + second_tin_notice == o.second_tin_notice && + 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_health_care_payments == o.medical_health_care_payments && + payer_made_direct_sales == o.payer_made_direct_sales && + substitute_payments == o.substitute_payments && + crop_insurance_proceeds == o.crop_insurance_proceeds && + gross_proceeds_paid_to_attorney == o.gross_proceeds_paid_to_attorney && + fish_purchased_for_resale == o.fish_purchased_for_resale && + section409_a_deferrals == o.section409_a_deferrals && + fatca_filing_requirement == o.fatca_filing_requirement && + excess_golden_parachute_payments == o.excess_golden_parachute_payments && + nonqualified_deferred_compensation == o.nonqualified_deferred_compensation && + 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 && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, 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, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_nec.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec.rb new file mode 100644 index 0000000..b0e7c6a --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec.rb @@ -0,0 +1,571 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099Nec + attr_accessor :nonemployee_compensation + + attr_accessor :federal_income_tax_withheld + + attr_accessor :direct_sales_indicator + + attr_accessor :id + + attr_accessor :type + + attr_accessor :issuer_id + + attr_accessor :issuer_reference_id + + attr_accessor :issuer_tin + + attr_accessor :tax_year + + attr_accessor :federal_efile + + attr_accessor :federal_efile_status + + attr_accessor :state_efile + + attr_accessor :state_efile_status + + attr_accessor :postal_mail + + attr_accessor :postal_mail_status + + attr_accessor :tin_match + + attr_accessor :tin_match_status + + attr_accessor :address_verification + + attr_accessor :address_verification_status + + attr_accessor :reference_id + + attr_accessor :email + + attr_accessor :type_of_tin + + attr_accessor :tin + + attr_accessor :first_payee_name + + attr_accessor :second_payee_name + + attr_accessor :address + + attr_accessor :address_recipient_second + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :validation_errors + + attr_accessor :created_at + + 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', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'first_payee_name' => :'firstPayeeName', + :'second_payee_name' => :'secondPayeeName', + :'address' => :'address', + :'address_recipient_second' => :'addressRecipientSecond', + :'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' => :'Form1099StatusDetail', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetail', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetail', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetail', + :'reference_id' => :'String', + :'email' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'first_payee_name' => :'String', + :'second_payee_name' => :'String', + :'address' => :'String', + :'address_recipient_second' => :'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' => :'StateAndLocalWithholding' + } + 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', + :'type_of_tin', + :'tin', + :'first_payee_name', + :'second_payee_name', + :'address', + :'address_recipient_second', + :'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 + [ + :'Form1099Base' + ] + 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::Form1099Nec` 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::Form1099Nec`. 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'] + 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?(:'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'] + 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'] + 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'] + 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'] + 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'] + 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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'first_payee_name') + self.first_payee_name = attributes[:'first_payee_name'] + end + + if attributes.key?(:'second_payee_name') + self.second_payee_name = attributes[:'second_payee_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address_recipient_second') + self.address_recipient_second = attributes[:'address_recipient_second'] + 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 + 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] 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 && + type_of_tin == o.type_of_tin && + tin == o.tin && + first_payee_name == o.first_payee_name && + second_payee_name == o.second_payee_name && + address == o.address && + address_recipient_second == o.address_recipient_second && + 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, type_of_tin, tin, first_payee_name, second_payee_name, address, address_recipient_second, 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_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb new file mode 100644 index 0000000..4a16756 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb @@ -0,0 +1,238 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099NecList + 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::Form1099NecList` 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::Form1099NecList`. 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/form1099_nec_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb new file mode 100644 index 0000000..5ec80b1 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb @@ -0,0 +1,469 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099NecListItem + attr_accessor :state_and_local_withholding + + attr_accessor :second_tin_notice + + attr_accessor :nonemployee_compensation + + attr_accessor :payer_made_direct_sales + + attr_accessor :federal_income_tax_withheld + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'second_tin_notice' => :'secondTinNotice', + :'nonemployee_compensation' => :'nonemployeeCompensation', + :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholding', + :'second_tin_notice' => :'Boolean', + :'nonemployee_compensation' => :'Float', + :'payer_made_direct_sales' => :'Boolean', + :'federal_income_tax_withheld' => :'Float', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099NecListItem` 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::Form1099NecListItem`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'second_tin_notice') + self.second_tin_notice = attributes[:'second_tin_notice'] + end + + if attributes.key?(:'nonemployee_compensation') + self.nonemployee_compensation = attributes[:'nonemployee_compensation'] + end + + if attributes.key?(:'payer_made_direct_sales') + self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + 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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + state_and_local_withholding == o.state_and_local_withholding && + second_tin_notice == o.second_tin_notice && + nonemployee_compensation == o.nonemployee_compensation && + payer_made_direct_sales == o.payer_made_direct_sales && + federal_income_tax_withheld == o.federal_income_tax_withheld && + 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 && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, second_tin_notice, nonemployee_compensation, payer_made_direct_sales, federal_income_tax_withheld, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_nec_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb new file mode 100644 index 0000000..02a4979 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb @@ -0,0 +1,478 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099NecRequest + attr_accessor :state_and_local_withholding + + attr_accessor :second_tin_notice + + attr_accessor :nonemployee_compensation + + attr_accessor :payer_made_direct_sales + + attr_accessor :federal_income_tax_withheld + + attr_accessor :type + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'second_tin_notice' => :'secondTinNotice', + :'nonemployee_compensation' => :'nonemployeeCompensation', + :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest', + :'second_tin_notice' => :'Boolean', + :'nonemployee_compensation' => :'Float', + :'payer_made_direct_sales' => :'Boolean', + :'federal_income_tax_withheld' => :'Float', + :'type' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099NecRequest` 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::Form1099NecRequest`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'second_tin_notice') + self.second_tin_notice = attributes[:'second_tin_notice'] + end + + if attributes.key?(:'nonemployee_compensation') + self.nonemployee_compensation = attributes[:'nonemployee_compensation'] + end + + if attributes.key?(:'payer_made_direct_sales') + self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + 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?(:'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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + state_and_local_withholding == o.state_and_local_withholding && + second_tin_notice == o.second_tin_notice && + nonemployee_compensation == o.nonemployee_compensation && + payer_made_direct_sales == o.payer_made_direct_sales && + federal_income_tax_withheld == o.federal_income_tax_withheld && + 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 && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, second_tin_notice, nonemployee_compensation, payer_made_direct_sales, federal_income_tax_withheld, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_proccess_result.rb b/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb new file mode 100644 index 0000000..9ba21d7 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb @@ -0,0 +1,210 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099ProccessResult + attr_accessor :job_data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'job_data' => :'jobData' + } + 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 + { + :'job_data' => :'Data' + } + 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::A1099::V2::Form1099ProccessResult` 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::Form1099ProccessResult`. 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?(:'job_data') + self.job_data = attributes[:'job_data'] + 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 && + job_data == o.job_data + 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 + [job_data].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.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r.rb new file mode 100644 index 0000000..e10caa3 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r.rb @@ -0,0 +1,742 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099R + attr_accessor :gross_distributions + + attr_accessor :taxable_amount + + attr_accessor :taxable_amount_not_determined + + attr_accessor :total_distribution_indicator + + attr_accessor :capital_gain + + attr_accessor :fed_income_tax_withheld + + attr_accessor :employee_contributions + + attr_accessor :net_unrealized_appreciation + + attr_accessor :distribution_code_required + + attr_accessor :distribution_code_optional + + attr_accessor :ira_sep_simple_indicator + + attr_accessor :total_ira_sep_simple_distribution + + attr_accessor :other + + attr_accessor :other_percent + + attr_accessor :percentage_total_distribution + + attr_accessor :total_employee_contributions + + attr_accessor :amount_allocable_to_irr + + attr_accessor :first_year_designated_roth_contrib + + attr_accessor :fatca_requirement_indicator + + attr_accessor :date_of_payment + + attr_accessor :id + + attr_accessor :type + + attr_accessor :issuer_id + + attr_accessor :issuer_reference_id + + attr_accessor :issuer_tin + + attr_accessor :tax_year + + attr_accessor :federal_efile + + attr_accessor :federal_efile_status + + attr_accessor :state_efile + + attr_accessor :state_efile_status + + attr_accessor :postal_mail + + attr_accessor :postal_mail_status + + attr_accessor :tin_match + + attr_accessor :tin_match_status + + attr_accessor :address_verification + + attr_accessor :address_verification_status + + attr_accessor :reference_id + + attr_accessor :email + + attr_accessor :type_of_tin + + attr_accessor :tin + + attr_accessor :first_payee_name + + attr_accessor :second_payee_name + + attr_accessor :address + + attr_accessor :address_recipient_second + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :foreign_province + + attr_accessor :country_code + + attr_accessor :validation_errors + + attr_accessor :created_at + + 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', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'first_payee_name' => :'firstPayeeName', + :'second_payee_name' => :'secondPayeeName', + :'address' => :'address', + :'address_recipient_second' => :'addressRecipientSecond', + :'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' => :'Form1099StatusDetail', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetail', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetail', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetail', + :'reference_id' => :'String', + :'email' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'first_payee_name' => :'String', + :'second_payee_name' => :'String', + :'address' => :'String', + :'address_recipient_second' => :'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' => :'StateAndLocalWithholding' + } + 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', + :'type_of_tin', + :'tin', + :'first_payee_name', + :'second_payee_name', + :'address', + :'address_recipient_second', + :'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 + [ + :'Form1099Base' + ] + 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::Form1099R` 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::Form1099R`. 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'] + 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?(:'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'] + 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'] + 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'] + 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'] + 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'] + 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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'first_payee_name') + self.first_payee_name = attributes[:'first_payee_name'] + end + + if attributes.key?(:'second_payee_name') + self.second_payee_name = attributes[:'second_payee_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address_recipient_second') + self.address_recipient_second = attributes[:'address_recipient_second'] + 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 + 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] 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 && + type_of_tin == o.type_of_tin && + tin == o.tin && + first_payee_name == o.first_payee_name && + second_payee_name == o.second_payee_name && + address == o.address && + address_recipient_second == o.address_recipient_second && + 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, type_of_tin, tin, first_payee_name, second_payee_name, address, address_recipient_second, 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_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb new file mode 100644 index 0000000..fa7aac5 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb @@ -0,0 +1,238 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099RList + 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::Form1099RList` 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::Form1099RList`. 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/form1099_r_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb new file mode 100644 index 0000000..d2e9218 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb @@ -0,0 +1,660 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099RListItem + attr_accessor :state_and_local_withholding + + attr_accessor :gross_distribution + + attr_accessor :taxable_amount + + attr_accessor :taxable_amount_not_determined + + attr_accessor :total_distribution_determined + + attr_accessor :capital_gain + + attr_accessor :federal_income_tax_withheld + + attr_accessor :employee_contributions_or_designated_roth_or_insurance_premiums + + attr_accessor :net_unrealized_appreciation_in_employer_securities + + attr_accessor :distribution_code + + attr_accessor :second_distribution_code + + attr_accessor :ira_sep_simple + + attr_accessor :traditional_ira_sep_simple_or_roth_conversion_amount + + attr_accessor :other_amount + + attr_accessor :other_percentage + + attr_accessor :total_distribution_percentage + + attr_accessor :total_employee_contributions + + attr_accessor :amount_allocable_to_irr_within5_years + + attr_accessor :first_year_of_designated_roth_contribution + + attr_accessor :fatca_filing_requirement + + attr_accessor :date_of_payment + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + 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 + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'gross_distribution' => :'grossDistribution', + :'taxable_amount' => :'taxableAmount', + :'taxable_amount_not_determined' => :'taxableAmountNotDetermined', + :'total_distribution_determined' => :'totalDistributionDetermined', + :'capital_gain' => :'capitalGain', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'employee_contributions_or_designated_roth_or_insurance_premiums' => :'employeeContributionsOrDesignatedRothOrInsurancePremiums', + :'net_unrealized_appreciation_in_employer_securities' => :'netUnrealizedAppreciationInEmployerSecurities', + :'distribution_code' => :'distributionCode', + :'second_distribution_code' => :'secondDistributionCode', + :'ira_sep_simple' => :'iraSepSimple', + :'traditional_ira_sep_simple_or_roth_conversion_amount' => :'traditionalIraSepSimpleOrRothConversionAmount', + :'other_amount' => :'otherAmount', + :'other_percentage' => :'otherPercentage', + :'total_distribution_percentage' => :'totalDistributionPercentage', + :'total_employee_contributions' => :'totalEmployeeContributions', + :'amount_allocable_to_irr_within5_years' => :'amountAllocableToIrrWithin5Years', + :'first_year_of_designated_roth_contribution' => :'firstYearOfDesignatedRothContribution', + :'fatca_filing_requirement' => :'fatcaFilingRequirement', + :'date_of_payment' => :'dateOfPayment', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholding', + :'gross_distribution' => :'Float', + :'taxable_amount' => :'Float', + :'taxable_amount_not_determined' => :'Boolean', + :'total_distribution_determined' => :'Boolean', + :'capital_gain' => :'Float', + :'federal_income_tax_withheld' => :'Float', + :'employee_contributions_or_designated_roth_or_insurance_premiums' => :'Float', + :'net_unrealized_appreciation_in_employer_securities' => :'Float', + :'distribution_code' => :'String', + :'second_distribution_code' => :'String', + :'ira_sep_simple' => :'Boolean', + :'traditional_ira_sep_simple_or_roth_conversion_amount' => :'Float', + :'other_amount' => :'Float', + :'other_percentage' => :'String', + :'total_distribution_percentage' => :'String', + :'total_employee_contributions' => :'Float', + :'amount_allocable_to_irr_within5_years' => :'Float', + :'first_year_of_designated_roth_contribution' => :'Integer', + :'fatca_filing_requirement' => :'Boolean', + :'date_of_payment' => :'Time', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + :'second_distribution_code', + ]) + 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::Form1099RListItem` 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::Form1099RListItem`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'gross_distribution') + self.gross_distribution = attributes[:'gross_distribution'] + 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_determined') + self.total_distribution_determined = attributes[:'total_distribution_determined'] + end + + if attributes.key?(:'capital_gain') + self.capital_gain = attributes[:'capital_gain'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + end + + if attributes.key?(:'employee_contributions_or_designated_roth_or_insurance_premiums') + self.employee_contributions_or_designated_roth_or_insurance_premiums = attributes[:'employee_contributions_or_designated_roth_or_insurance_premiums'] + end + + if attributes.key?(:'net_unrealized_appreciation_in_employer_securities') + self.net_unrealized_appreciation_in_employer_securities = attributes[:'net_unrealized_appreciation_in_employer_securities'] + end + + if attributes.key?(:'distribution_code') + self.distribution_code = attributes[:'distribution_code'] + end + + if attributes.key?(:'second_distribution_code') + self.second_distribution_code = attributes[:'second_distribution_code'] + end + + if attributes.key?(:'ira_sep_simple') + self.ira_sep_simple = attributes[:'ira_sep_simple'] + end + + if attributes.key?(:'traditional_ira_sep_simple_or_roth_conversion_amount') + self.traditional_ira_sep_simple_or_roth_conversion_amount = attributes[:'traditional_ira_sep_simple_or_roth_conversion_amount'] + end + + if attributes.key?(:'other_amount') + self.other_amount = attributes[:'other_amount'] + end + + if attributes.key?(:'other_percentage') + self.other_percentage = attributes[:'other_percentage'] + end + + if attributes.key?(:'total_distribution_percentage') + self.total_distribution_percentage = attributes[:'total_distribution_percentage'] + end + + if attributes.key?(:'total_employee_contributions') + self.total_employee_contributions = attributes[:'total_employee_contributions'] + end + + if attributes.key?(:'amount_allocable_to_irr_within5_years') + self.amount_allocable_to_irr_within5_years = attributes[:'amount_allocable_to_irr_within5_years'] + end + + if attributes.key?(:'first_year_of_designated_roth_contribution') + self.first_year_of_designated_roth_contribution = attributes[:'first_year_of_designated_roth_contribution'] + end + + if attributes.key?(:'fatca_filing_requirement') + self.fatca_filing_requirement = attributes[:'fatca_filing_requirement'] + end + + if attributes.key?(:'date_of_payment') + self.date_of_payment = attributes[:'date_of_payment'] + 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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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' + 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 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) + 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"]) + unless validator.valid?(distribution_code) + fail ArgumentError, "invalid value for \"distribution_code\", must be one of #{validator.allowable_values}." + end + @distribution_code = distribution_code + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] second_distribution_code Object to be assigned + def second_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"]) + unless validator.valid?(second_distribution_code) + fail ArgumentError, "invalid value for \"second_distribution_code\", must be one of #{validator.allowable_values}." + end + @second_distribution_code = second_distribution_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 && + state_and_local_withholding == o.state_and_local_withholding && + gross_distribution == o.gross_distribution && + taxable_amount == o.taxable_amount && + taxable_amount_not_determined == o.taxable_amount_not_determined && + total_distribution_determined == o.total_distribution_determined && + capital_gain == o.capital_gain && + federal_income_tax_withheld == o.federal_income_tax_withheld && + employee_contributions_or_designated_roth_or_insurance_premiums == o.employee_contributions_or_designated_roth_or_insurance_premiums && + net_unrealized_appreciation_in_employer_securities == o.net_unrealized_appreciation_in_employer_securities && + distribution_code == o.distribution_code && + second_distribution_code == o.second_distribution_code && + ira_sep_simple == o.ira_sep_simple && + traditional_ira_sep_simple_or_roth_conversion_amount == o.traditional_ira_sep_simple_or_roth_conversion_amount && + other_amount == o.other_amount && + other_percentage == o.other_percentage && + total_distribution_percentage == o.total_distribution_percentage && + total_employee_contributions == o.total_employee_contributions && + amount_allocable_to_irr_within5_years == o.amount_allocable_to_irr_within5_years && + first_year_of_designated_roth_contribution == o.first_year_of_designated_roth_contribution && + fatca_filing_requirement == o.fatca_filing_requirement && + date_of_payment == o.date_of_payment && + 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 && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, 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_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_r_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb new file mode 100644 index 0000000..01a017b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb @@ -0,0 +1,622 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099RRequest + attr_accessor :state_and_local_withholding + + attr_accessor :gross_distribution + + attr_accessor :taxable_amount + + attr_accessor :taxable_amount_not_determined + + attr_accessor :total_distribution_determined + + attr_accessor :capital_gain + + attr_accessor :federal_income_tax_withheld + + attr_accessor :employee_contributions_or_designated_roth_or_insurance_premiums + + attr_accessor :net_unrealized_appreciation_in_employer_securities + + attr_accessor :distribution_code + + attr_accessor :second_distribution_code + + attr_accessor :ira_sep_simple + + attr_accessor :traditional_ira_sep_simple_or_roth_conversion_amount + + attr_accessor :other_amount + + attr_accessor :other_percentage + + attr_accessor :total_distribution_percentage + + attr_accessor :total_employee_contributions + + attr_accessor :amount_allocable_to_irr_within5_years + + attr_accessor :first_year_of_designated_roth_contribution + + attr_accessor :fatca_filing_requirement + + attr_accessor :date_of_payment + + attr_accessor :type + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'gross_distribution' => :'grossDistribution', + :'taxable_amount' => :'taxableAmount', + :'taxable_amount_not_determined' => :'taxableAmountNotDetermined', + :'total_distribution_determined' => :'totalDistributionDetermined', + :'capital_gain' => :'capitalGain', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'employee_contributions_or_designated_roth_or_insurance_premiums' => :'employeeContributionsOrDesignatedRothOrInsurancePremiums', + :'net_unrealized_appreciation_in_employer_securities' => :'netUnrealizedAppreciationInEmployerSecurities', + :'distribution_code' => :'distributionCode', + :'second_distribution_code' => :'secondDistributionCode', + :'ira_sep_simple' => :'iraSepSimple', + :'traditional_ira_sep_simple_or_roth_conversion_amount' => :'traditionalIraSepSimpleOrRothConversionAmount', + :'other_amount' => :'otherAmount', + :'other_percentage' => :'otherPercentage', + :'total_distribution_percentage' => :'totalDistributionPercentage', + :'total_employee_contributions' => :'totalEmployeeContributions', + :'amount_allocable_to_irr_within5_years' => :'amountAllocableToIrrWithin5Years', + :'first_year_of_designated_roth_contribution' => :'firstYearOfDesignatedRothContribution', + :'fatca_filing_requirement' => :'fatcaFilingRequirement', + :'date_of_payment' => :'dateOfPayment', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest', + :'gross_distribution' => :'Float', + :'taxable_amount' => :'Float', + :'taxable_amount_not_determined' => :'Boolean', + :'total_distribution_determined' => :'Boolean', + :'capital_gain' => :'Float', + :'federal_income_tax_withheld' => :'Float', + :'employee_contributions_or_designated_roth_or_insurance_premiums' => :'Float', + :'net_unrealized_appreciation_in_employer_securities' => :'Float', + :'distribution_code' => :'String', + :'second_distribution_code' => :'String', + :'ira_sep_simple' => :'Boolean', + :'traditional_ira_sep_simple_or_roth_conversion_amount' => :'Float', + :'other_amount' => :'Float', + :'other_percentage' => :'String', + :'total_distribution_percentage' => :'String', + :'total_employee_contributions' => :'Float', + :'amount_allocable_to_irr_within5_years' => :'Float', + :'first_year_of_designated_roth_contribution' => :'String', + :'fatca_filing_requirement' => :'Boolean', + :'date_of_payment' => :'Time', + :'type' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::Form1099RRequest` 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::Form1099RRequest`. 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?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'gross_distribution') + self.gross_distribution = attributes[:'gross_distribution'] + 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_determined') + self.total_distribution_determined = attributes[:'total_distribution_determined'] + end + + if attributes.key?(:'capital_gain') + self.capital_gain = attributes[:'capital_gain'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + end + + if attributes.key?(:'employee_contributions_or_designated_roth_or_insurance_premiums') + self.employee_contributions_or_designated_roth_or_insurance_premiums = attributes[:'employee_contributions_or_designated_roth_or_insurance_premiums'] + end + + if attributes.key?(:'net_unrealized_appreciation_in_employer_securities') + self.net_unrealized_appreciation_in_employer_securities = attributes[:'net_unrealized_appreciation_in_employer_securities'] + end + + if attributes.key?(:'distribution_code') + self.distribution_code = attributes[:'distribution_code'] + end + + if attributes.key?(:'second_distribution_code') + self.second_distribution_code = attributes[:'second_distribution_code'] + end + + if attributes.key?(:'ira_sep_simple') + self.ira_sep_simple = attributes[:'ira_sep_simple'] + end + + if attributes.key?(:'traditional_ira_sep_simple_or_roth_conversion_amount') + self.traditional_ira_sep_simple_or_roth_conversion_amount = attributes[:'traditional_ira_sep_simple_or_roth_conversion_amount'] + end + + if attributes.key?(:'other_amount') + self.other_amount = attributes[:'other_amount'] + end + + if attributes.key?(:'other_percentage') + self.other_percentage = attributes[:'other_percentage'] + end + + if attributes.key?(:'total_distribution_percentage') + self.total_distribution_percentage = attributes[:'total_distribution_percentage'] + end + + if attributes.key?(:'total_employee_contributions') + self.total_employee_contributions = attributes[:'total_employee_contributions'] + end + + if attributes.key?(:'amount_allocable_to_irr_within5_years') + self.amount_allocable_to_irr_within5_years = attributes[:'amount_allocable_to_irr_within5_years'] + end + + if attributes.key?(:'first_year_of_designated_roth_contribution') + self.first_year_of_designated_roth_contribution = attributes[:'first_year_of_designated_roth_contribution'] + end + + if attributes.key?(:'fatca_filing_requirement') + self.fatca_filing_requirement = attributes[:'fatca_filing_requirement'] + end + + if attributes.key?(:'date_of_payment') + self.date_of_payment = attributes[:'date_of_payment'] + 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?(:'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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + state_and_local_withholding == o.state_and_local_withholding && + gross_distribution == o.gross_distribution && + taxable_amount == o.taxable_amount && + taxable_amount_not_determined == o.taxable_amount_not_determined && + total_distribution_determined == o.total_distribution_determined && + capital_gain == o.capital_gain && + federal_income_tax_withheld == o.federal_income_tax_withheld && + employee_contributions_or_designated_roth_or_insurance_premiums == o.employee_contributions_or_designated_roth_or_insurance_premiums && + net_unrealized_appreciation_in_employer_securities == o.net_unrealized_appreciation_in_employer_securities && + distribution_code == o.distribution_code && + second_distribution_code == o.second_distribution_code && + ira_sep_simple == o.ira_sep_simple && + traditional_ira_sep_simple_or_roth_conversion_amount == o.traditional_ira_sep_simple_or_roth_conversion_amount && + other_amount == o.other_amount && + other_percentage == o.other_percentage && + total_distribution_percentage == o.total_distribution_percentage && + total_employee_contributions == o.total_employee_contributions && + amount_allocable_to_irr_within5_years == o.amount_allocable_to_irr_within5_years && + first_year_of_designated_roth_contribution == o.first_year_of_designated_roth_contribution && + fatca_filing_requirement == o.fatca_filing_requirement && + date_of_payment == o.date_of_payment && + 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 && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [state_and_local_withholding, 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, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form1099_status_detail.rb b/lib/avalara_sdk/models/A1099/V2/form1099_status_detail.rb new file mode 100644 index 0000000..7ca74af --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_status_detail.rb @@ -0,0 +1,221 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099StatusDetail + attr_accessor :time + + 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::Form1099StatusDetail` 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::Form1099StatusDetail`. 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 new file mode 100644 index 0000000..9f888d9 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form_request_base.rb @@ -0,0 +1,417 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class FormRequestBase + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::FormRequestBase` 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::FormRequestBase`. 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_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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + 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 && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/form_request_model.rb b/lib/avalara_sdk/models/A1099/V2/form_request_model.rb new file mode 100644 index 0000000..85eb506 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form_request_model.rb @@ -0,0 +1,345 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class FormRequestModel + attr_accessor :id + + attr_accessor :type + + # \"W9\" is currently the only supported value + attr_accessor :form_type + + # Track1099's ID of your company, found in the W-9 UI + attr_accessor :company_id + + # Name of your company, set in the W-9 UI + attr_accessor :company_name + + # Contact email of your company, set in the W-9 UI + attr_accessor :company_email + + # Your internal identifier for the vendor from whom you are requesting a form + attr_accessor :reference_id + + # The timestamp this vendor (identified by your ReferenceId) last signed a complete W-9, null if you did not include a ReferenceId or the vendor has not yet signed a W-9 in Track1099 + attr_accessor :signed_at + + # Result of IRS TIN match query for name and TIN in the last signed form, null if signed_at is null + attr_accessor :tin_match_status + + # Timestamp when this FormRequest will expire, ttl (or 3600) seconds from creation + attr_accessor :expires_at + + # URL of PDF representation of just-signed form, otherwise null. Integrations may use this value to offer a \"download for your records\" function after a vendor completes and signs a form. Link expires at the same time as this FormRequest. Treat the format of this URL as opaque and expect it to change in the future. + attr_accessor :signed_pdf + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'form_type' => :'formType', + :'company_id' => :'companyId', + :'company_name' => :'companyName', + :'company_email' => :'companyEmail', + :'reference_id' => :'referenceId', + :'signed_at' => :'signedAt', + :'tin_match_status' => :'tinMatchStatus', + :'expires_at' => :'expiresAt', + :'signed_pdf' => :'signedPdf' + } + 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', + :'form_type' => :'String', + :'company_id' => :'Integer', + :'company_name' => :'String', + :'company_email' => :'String', + :'reference_id' => :'String', + :'signed_at' => :'Time', + :'tin_match_status' => :'String', + :'expires_at' => :'Time', + :'signed_pdf' => :'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::A1099::V2::FormRequestModel` 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::FormRequestModel`. 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?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'form_type') + self.form_type = attributes[:'form_type'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] + end + + if attributes.key?(:'company_email') + self.company_email = attributes[:'company_email'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'signed_at') + self.signed_at = attributes[:'signed_at'] + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'signed_pdf') + self.signed_pdf = attributes[:'signed_pdf'] + 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', ["FormRequest"]) + return false unless type_validator.valid?(@type) + form_type_validator = EnumAttributeValidator.new('String', ["W9"]) + return false unless form_type_validator.valid?(@form_type) + tin_match_status_validator = EnumAttributeValidator.new('String', ["None", "Matched"]) + return false unless tin_match_status_validator.valid?(@tin_match_status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["FormRequest"]) + 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] form_type Object to be assigned + def form_type=(form_type) + validator = EnumAttributeValidator.new('String', ["W9"]) + unless validator.valid?(form_type) + fail ArgumentError, "invalid value for \"form_type\", must be one of #{validator.allowable_values}." + end + @form_type = form_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] tin_match_status Object to be assigned + def tin_match_status=(tin_match_status) + validator = EnumAttributeValidator.new('String', ["None", "Matched"]) + unless validator.valid?(tin_match_status) + fail ArgumentError, "invalid value for \"tin_match_status\", must be one of #{validator.allowable_values}." + end + @tin_match_status = tin_match_status + 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 && + form_type == o.form_type && + company_id == o.company_id && + company_name == o.company_name && + company_email == o.company_email && + reference_id == o.reference_id && + signed_at == o.signed_at && + tin_match_status == o.tin_match_status && + expires_at == o.expires_at && + signed_pdf == o.signed_pdf + 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, form_type, company_id, company_name, company_email, reference_id, signed_at, tin_match_status, expires_at, signed_pdf].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 new file mode 100644 index 0000000..c2c485b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form_response_base.rb @@ -0,0 +1,372 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class FormResponseBase + 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_federal_id + + attr_accessor :federal_id_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_federal_id' => :'recipientFederalId', + :'federal_id_type' => :'federalIdType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'recipient_email' => :'recipientEmail', + :'account_number' => :'accountNumber', + :'office_code' => :'officeCode', + :'recipient_non_us_province' => :'recipientNonUsProvince', + :'country_code' => :'countryCode' + } + 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_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_federal_id' => :'String', + :'federal_id_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'recipient_email' => :'String', + :'account_number' => :'String', + :'office_code' => :'String', + :'recipient_non_us_province' => :'String', + :'country_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::A1099::V2::FormResponseBase` 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::FormResponseBase`. 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_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_federal_id') + self.recipient_federal_id = attributes[:'recipient_federal_id'] + end + + if attributes.key?(:'federal_id_type') + self.federal_id_type = attributes[:'federal_id_type'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + 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_federal_id == o.recipient_federal_id && + federal_id_type == o.federal_id_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + 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_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_federal_id, federal_id_type, recipient_second_name, street_address, street_address_line2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_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::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_single_request_base.rb b/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb new file mode 100644 index 0000000..6dd1cf0 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb @@ -0,0 +1,433 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class FormSingleRequestBase + attr_accessor :type + + 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 :tin_type + + attr_accessor :recipient_second_name + + attr_accessor :street_address + + attr_accessor :street_address_line2 + + 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 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'street_address' => :'streetAddress', + :'street_address_line2' => :'streetAddressLine2', + :'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 + { + :'type' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'tin_type' => :'Integer', + :'recipient_second_name' => :'String', + :'street_address' => :'String', + :'street_address_line2' => :'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([ + ]) + 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::FormSingleRequestBase` 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::FormSingleRequestBase`. 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?(:'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?(:'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?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'street_address_line2') + self.street_address_line2 = attributes[:'street_address_line2'] + 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 + 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 && + 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 && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + street_address == o.street_address && + street_address_line2 == o.street_address_line2 && + 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 + [type, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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/http_validation_problem_details.rb b/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb new file mode 100644 index 0000000..210d8c3 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb @@ -0,0 +1,269 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class HttpValidationProblemDetails + attr_accessor :errors + + attr_accessor :type + + attr_accessor :title + + attr_accessor :status + + attr_accessor :detail + + attr_accessor :instance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors', + :'type' => :'type', + :'title' => :'title', + :'status' => :'status', + :'detail' => :'detail', + :'instance' => :'instance' + } + 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 + { + :'errors' => :'Hash>', + :'type' => :'String', + :'title' => :'String', + :'status' => :'Integer', + :'detail' => :'String', + :'instance' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'type', + :'title', + :'status', + :'detail', + :'instance' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'ProblemDetails' + ] + 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::HttpValidationProblemDetails` 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::HttpValidationProblemDetails`. 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?(:'errors') + if (value = attributes[:'errors']).is_a?(Hash) + self.errors = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + 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 && + errors == o.errors && + type == o.type && + title == o.title && + status == o.status && + detail == o.detail && + instance == o.instance + 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 + [errors, type, title, status, detail, instance].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/i_create_form1099_request.rb b/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb new file mode 100644 index 0000000..708a0a5 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb @@ -0,0 +1,102 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module ICreateForm1099Request + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Form1099DivRequest', + :'Form1099MiscRequest', + :'Form1099NecRequest' + ] + 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/i_update_form1099_request.rb b/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb new file mode 100644 index 0000000..4766bcc --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb @@ -0,0 +1,102 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module IUpdateForm1099Request + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Form1099DivRequest', + :'Form1099MiscRequest', + :'Form1099NecRequest' + ] + 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/issuer_command.rb b/lib/avalara_sdk/models/A1099/V2/issuer_command.rb new file mode 100644 index 0000000..5833721 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/issuer_command.rb @@ -0,0 +1,364 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class IssuerCommand + # Legal name, not DBA + attr_accessor :name + + # Optional DBA name or continuation of a long legal name + attr_accessor :name_dba + + # Tax identification number + attr_accessor :tin + + # Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. + attr_accessor :reference_id + + # Telephone number + attr_accessor :telephone + + # Tax year + attr_accessor :tax_year + + # If there is a transfer agent, use the shipping address of the transfer agent. + attr_accessor :country_code + + # Email address + attr_accessor :email + + # Address + attr_accessor :address + + # City + attr_accessor :city + + # State + attr_accessor :state + + # Zip code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Transfer Agent's Name + attr_accessor :transfer_agent_name + + # Last year of filing for this payer + attr_accessor :last_filing + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'name_dba' => :'nameDba', + :'tin' => :'tin', + :'reference_id' => :'referenceId', + :'telephone' => :'telephone', + :'tax_year' => :'taxYear', + :'country_code' => :'countryCode', + :'email' => :'email', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'transfer_agent_name' => :'transferAgentName', + :'last_filing' => :'lastFiling' + } + 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', + :'name_dba' => :'String', + :'tin' => :'String', + :'reference_id' => :'String', + :'telephone' => :'String', + :'tax_year' => :'Integer', + :'country_code' => :'String', + :'email' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'transfer_agent_name' => :'String', + :'last_filing' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'name_dba', + :'tin', + :'reference_id', + :'telephone', + :'country_code', + :'email', + :'address', + :'city', + :'state', + :'zip', + :'foreign_province', + :'transfer_agent_name', + :'last_filing' + ]) + 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::IssuerCommand` 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::IssuerCommand`. 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?(:'name_dba') + self.name_dba = attributes[:'name_dba'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + 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?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'transfer_agent_name') + self.transfer_agent_name = attributes[:'transfer_agent_name'] + end + + if attributes.key?(:'last_filing') + self.last_filing = attributes[:'last_filing'] + 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 && + name_dba == o.name_dba && + tin == o.tin && + reference_id == o.reference_id && + telephone == o.telephone && + tax_year == o.tax_year && + country_code == o.country_code && + email == o.email && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + transfer_agent_name == o.transfer_agent_name && + last_filing == o.last_filing + 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, name_dba, tin, reference_id, telephone, tax_year, country_code, email, address, city, state, zip, foreign_province, transfer_agent_name, last_filing].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_response.rb b/lib/avalara_sdk/models/A1099/V2/issuer_response.rb new file mode 100644 index 0000000..eb9bc6d --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/issuer_response.rb @@ -0,0 +1,390 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class IssuerResponse + # Unique identifier set when the record is created + attr_accessor :id + + # Legal name, not DBA + attr_accessor :name + + # Optional DBA name or continuation of a long legal name + attr_accessor :name_dba + + # Tax identification number + attr_accessor :tin + + # Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. + attr_accessor :reference_id + + # Telephone number + attr_accessor :telephone + + # Tax year + attr_accessor :tax_year + + # If there is a transfer agent, use the address of the transfer agent. + attr_accessor :country_code + + # Email address + attr_accessor :email + + # Address + attr_accessor :address + + # City + attr_accessor :city + + # State + attr_accessor :state + + # Zip code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Transfer Agent's Name + attr_accessor :transfer_agent_name + + # Last year of filing for this payer + attr_accessor :last_filing + + # Date time when the issuer was created + attr_accessor :created_at + + # Date time when the issuer was updated + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'name_dba' => :'nameDba', + :'tin' => :'tin', + :'reference_id' => :'referenceId', + :'telephone' => :'telephone', + :'tax_year' => :'taxYear', + :'country_code' => :'countryCode', + :'email' => :'email', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'transfer_agent_name' => :'transferAgentName', + :'last_filing' => :'lastFiling', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'name_dba' => :'String', + :'tin' => :'String', + :'reference_id' => :'String', + :'telephone' => :'String', + :'tax_year' => :'Integer', + :'country_code' => :'String', + :'email' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'transfer_agent_name' => :'String', + :'last_filing' => :'Boolean', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tax_year', + :'country_code', + :'email', + :'address', + :'city', + :'state', + :'zip', + :'foreign_province', + :'transfer_agent_name', + ]) + 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::IssuerResponse` 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::IssuerResponse`. 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'] + end + + if attributes.key?(:'name_dba') + self.name_dba = attributes[:'name_dba'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + 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?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'transfer_agent_name') + self.transfer_agent_name = attributes[:'transfer_agent_name'] + end + + if attributes.key?(:'last_filing') + self.last_filing = attributes[:'last_filing'] + 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 + 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 && + name == o.name && + name_dba == o.name_dba && + tin == o.tin && + reference_id == o.reference_id && + telephone == o.telephone && + tax_year == o.tax_year && + country_code == o.country_code && + email == o.email && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + transfer_agent_name == o.transfer_agent_name && + last_filing == o.last_filing && + created_at == o.created_at && + updated_at == o.updated_at + 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, name_dba, tin, reference_id, telephone, tax_year, country_code, email, address, city, state, zip, foreign_province, transfer_agent_name, last_filing, created_at, updated_at].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/iw9_form_data_models_one_of.rb b/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb new file mode 100644 index 0000000..de971e6 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb @@ -0,0 +1,105 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # Interface representing a union of W4FormDataModel, W8BeneFormDataModel, W8BenFormDataModel, W8ImyFormDataModel, or W9FormDataModel. Used only for OpenAPI documentation. + module IW9FormDataModelsOneOf + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'W4FormDataModel', + :'W8BenFormDataModel', + :'W8BeneFormDataModel', + :'W8ImyFormDataModel', + :'W9FormDataModel' + ] + 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/job_result.rb b/lib/avalara_sdk/models/A1099/V2/job_result.rb new file mode 100644 index 0000000..9c0fb3f --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/job_result.rb @@ -0,0 +1,366 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class JobResult + attr_accessor :id + + attr_accessor :type + + attr_accessor :dry_run + + attr_accessor :upsert + + attr_accessor :status + + attr_accessor :error_message + + attr_accessor :total_processed + + attr_accessor :total_rows + + attr_accessor :updated_valid + + attr_accessor :updated_no_email + + attr_accessor :updated_invalid + + attr_accessor :skipped_duplicate + + attr_accessor :skipped_invalid + + attr_accessor :skipped_multiple_matches + + attr_accessor :not_found + + attr_accessor :created_invalid + + attr_accessor :created_no_email + + attr_accessor :created_valid + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'dry_run' => :'dryRun', + :'upsert' => :'upsert', + :'status' => :'status', + :'error_message' => :'errorMessage', + :'total_processed' => :'totalProcessed', + :'total_rows' => :'totalRows', + :'updated_valid' => :'updatedValid', + :'updated_no_email' => :'updatedNoEmail', + :'updated_invalid' => :'updatedInvalid', + :'skipped_duplicate' => :'skippedDuplicate', + :'skipped_invalid' => :'skippedInvalid', + :'skipped_multiple_matches' => :'skippedMultipleMatches', + :'not_found' => :'notFound', + :'created_invalid' => :'createdInvalid', + :'created_no_email' => :'createdNoEmail', + :'created_valid' => :'createdValid' + } + 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', + :'dry_run' => :'Boolean', + :'upsert' => :'Boolean', + :'status' => :'String', + :'error_message' => :'String', + :'total_processed' => :'Integer', + :'total_rows' => :'Integer', + :'updated_valid' => :'Integer', + :'updated_no_email' => :'Integer', + :'updated_invalid' => :'Integer', + :'skipped_duplicate' => :'Integer', + :'skipped_invalid' => :'Integer', + :'skipped_multiple_matches' => :'Integer', + :'not_found' => :'Integer', + :'created_invalid' => :'Integer', + :'created_no_email' => :'Integer', + :'created_valid' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'type', + :'status', + :'error_message', + ]) + 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::JobResult` 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::JobResult`. 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?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'upsert') + self.upsert = attributes[:'upsert'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'total_processed') + self.total_processed = attributes[:'total_processed'] + end + + if attributes.key?(:'total_rows') + self.total_rows = attributes[:'total_rows'] + end + + if attributes.key?(:'updated_valid') + self.updated_valid = attributes[:'updated_valid'] + end + + if attributes.key?(:'updated_no_email') + self.updated_no_email = attributes[:'updated_no_email'] + end + + if attributes.key?(:'updated_invalid') + self.updated_invalid = attributes[:'updated_invalid'] + end + + if attributes.key?(:'skipped_duplicate') + self.skipped_duplicate = attributes[:'skipped_duplicate'] + end + + if attributes.key?(:'skipped_invalid') + self.skipped_invalid = attributes[:'skipped_invalid'] + end + + if attributes.key?(:'skipped_multiple_matches') + self.skipped_multiple_matches = attributes[:'skipped_multiple_matches'] + end + + if attributes.key?(:'not_found') + self.not_found = attributes[:'not_found'] + end + + if attributes.key?(:'created_invalid') + self.created_invalid = attributes[:'created_invalid'] + end + + if attributes.key?(:'created_no_email') + self.created_no_email = attributes[:'created_no_email'] + end + + if attributes.key?(:'created_valid') + self.created_valid = attributes[:'created_valid'] + 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 && + type == o.type && + dry_run == o.dry_run && + upsert == o.upsert && + status == o.status && + error_message == o.error_message && + total_processed == o.total_processed && + total_rows == o.total_rows && + updated_valid == o.updated_valid && + updated_no_email == o.updated_no_email && + updated_invalid == o.updated_invalid && + skipped_duplicate == o.skipped_duplicate && + skipped_invalid == o.skipped_invalid && + skipped_multiple_matches == o.skipped_multiple_matches && + not_found == o.not_found && + created_invalid == o.created_invalid && + created_no_email == o.created_no_email && + created_valid == o.created_valid + 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, dry_run, upsert, status, error_message, total_processed, total_rows, updated_valid, updated_no_email, updated_invalid, skipped_duplicate, skipped_invalid, skipped_multiple_matches, not_found, created_invalid, created_no_email, created_valid].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/link.rb b/lib/avalara_sdk/models/A1099/V2/link.rb new file mode 100644 index 0000000..b7c52e1 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/link.rb @@ -0,0 +1,210 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Link + attr_accessor :_self + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_self' => :'self' + } + 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 + { + :'_self' => :'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::A1099::V2::Link` 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::Link`. 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?(:'_self') + self._self = attributes[:'_self'] + 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 && + _self == o._self + 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 + [_self].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/paginated_query_result_model.rb b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb new file mode 100644 index 0000000..4148c31 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb @@ -0,0 +1,234 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # Generic paginated model to wrap query response data + class PaginatedQueryResultModel + attr_accessor :recordset_count + + attr_accessor :value + + attr_accessor :next_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recordset_count' => :'@recordsetCount', + :'value' => :'value', + :'next_link' => :'@nextLink' + } + 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 + { + :'recordset_count' => :'Integer', + :'value' => :'Array', + :'next_link' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'recordset_count', + :'value', + :'next_link' + ]) + 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::PaginatedQueryResultModel` 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::PaginatedQueryResultModel`. 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?(:'recordset_count') + self.recordset_count = attributes[:'recordset_count'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + + if attributes.key?(:'next_link') + self.next_link = attributes[:'next_link'] + 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 && + recordset_count == o.recordset_count && + value == o.value && + next_link == o.next_link + 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 + [recordset_count, value, next_link].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/paginated_query_result_model_company_response.rb b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb new file mode 100644 index 0000000..77aeaef --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb @@ -0,0 +1,234 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # Generic paginated model to wrap query response data + class PaginatedQueryResultModelCompanyResponse + attr_accessor :recordset_count + + attr_accessor :value + + attr_accessor :next_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recordset_count' => :'@recordsetCount', + :'value' => :'value', + :'next_link' => :'@nextLink' + } + 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 + { + :'recordset_count' => :'Integer', + :'value' => :'Array', + :'next_link' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'recordset_count', + :'value', + :'next_link' + ]) + 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::PaginatedQueryResultModelCompanyResponse` 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::PaginatedQueryResultModelCompanyResponse`. 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?(:'recordset_count') + self.recordset_count = attributes[:'recordset_count'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + + if attributes.key?(:'next_link') + self.next_link = attributes[:'next_link'] + 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 && + recordset_count == o.recordset_count && + value == o.value && + next_link == o.next_link + 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 + [recordset_count, value, next_link].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/paginated_query_result_model_issuer_response.rb b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb new file mode 100644 index 0000000..e3fe876 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb @@ -0,0 +1,234 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # Generic paginated model to wrap query response data + class PaginatedQueryResultModelIssuerResponse + attr_accessor :recordset_count + + attr_accessor :value + + attr_accessor :next_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recordset_count' => :'@recordsetCount', + :'value' => :'value', + :'next_link' => :'@nextLink' + } + 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 + { + :'recordset_count' => :'Integer', + :'value' => :'Array', + :'next_link' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'recordset_count', + :'value', + :'next_link' + ]) + 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::PaginatedQueryResultModelIssuerResponse` 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::PaginatedQueryResultModelIssuerResponse`. 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?(:'recordset_count') + self.recordset_count = attributes[:'recordset_count'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + + if attributes.key?(:'next_link') + self.next_link = attributes[:'next_link'] + 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 && + recordset_count == o.recordset_count && + value == o.value && + next_link == o.next_link + 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 + [recordset_count, value, next_link].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/paginated_w9_forms_model.rb b/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb new file mode 100644 index 0000000..3a7f5a5 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb @@ -0,0 +1,231 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # Paginated model for W9/W4/W8 forms query response data + class PaginatedW9FormsModel + attr_accessor :recordset_count + + attr_accessor :value + + attr_accessor :next_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recordset_count' => :'@recordsetCount', + :'value' => :'value', + :'next_link' => :'@nextLink' + } + 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 + { + :'recordset_count' => :'Integer', + :'value' => :'Array', + :'next_link' => :'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::A1099::V2::PaginatedW9FormsModel` 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::PaginatedW9FormsModel`. 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?(:'recordset_count') + self.recordset_count = attributes[:'recordset_count'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + + if attributes.key?(:'next_link') + self.next_link = attributes[:'next_link'] + 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 && + recordset_count == o.recordset_count && + value == o.value && + next_link == o.next_link + 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 + [recordset_count, value, next_link].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 new file mode 100644 index 0000000..739cadd --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/problem_details.rb @@ -0,0 +1,251 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class ProblemDetails + attr_accessor :type + + attr_accessor :title + + attr_accessor :status + + attr_accessor :detail + + attr_accessor :instance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'title' => :'title', + :'status' => :'status', + :'detail' => :'detail', + :'instance' => :'instance' + } + 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', + :'title' => :'String', + :'status' => :'Integer', + :'detail' => :'String', + :'instance' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'type', + :'title', + :'status', + :'detail', + :'instance' + ]) + 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::ProblemDetails` 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::ProblemDetails`. 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?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + 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 && + type == o.type && + title == o.title && + status == o.status && + detail == o.detail && + instance == o.instance + 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, title, status, detail, instance].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/state_and_local_withholding.rb b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding.rb new file mode 100644 index 0000000..f108199 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding.rb @@ -0,0 +1,281 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class StateAndLocalWithholding + attr_accessor :state_tax_withheld + + attr_accessor :state + + attr_accessor :state_id_number + + attr_accessor :state_income + + attr_accessor :local_tax_withheld + + attr_accessor :locality + + attr_accessor :locality_id_number + + attr_accessor :local_income + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_tax_withheld' => :'stateTaxWithheld', + :'state' => :'state', + :'state_id_number' => :'stateIdNumber', + :'state_income' => :'stateIncome', + :'local_tax_withheld' => :'localTaxWithheld', + :'locality' => :'locality', + :'locality_id_number' => :'localityIdNumber', + :'local_income' => :'localIncome' + } + 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 + { + :'state_tax_withheld' => :'Float', + :'state' => :'String', + :'state_id_number' => :'String', + :'state_income' => :'Float', + :'local_tax_withheld' => :'Float', + :'locality' => :'String', + :'locality_id_number' => :'String', + :'local_income' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'state_tax_withheld', + :'state', + :'state_id_number', + :'state_income', + :'local_tax_withheld', + :'locality', + :'locality_id_number', + :'local_income' + ]) + 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::StateAndLocalWithholding` 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::StateAndLocalWithholding`. 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?(:'state_tax_withheld') + self.state_tax_withheld = attributes[:'state_tax_withheld'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'state_id_number') + self.state_id_number = attributes[:'state_id_number'] + end + + if attributes.key?(:'state_income') + self.state_income = attributes[:'state_income'] + end + + if attributes.key?(:'local_tax_withheld') + self.local_tax_withheld = attributes[:'local_tax_withheld'] + end + + if attributes.key?(:'locality') + self.locality = attributes[:'locality'] + end + + if attributes.key?(:'locality_id_number') + self.locality_id_number = attributes[:'locality_id_number'] + end + + if attributes.key?(:'local_income') + self.local_income = attributes[:'local_income'] + 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 && + state_tax_withheld == o.state_tax_withheld && + state == o.state && + state_id_number == o.state_id_number && + state_income == o.state_income && + local_tax_withheld == o.local_tax_withheld && + locality == o.locality && + locality_id_number == o.locality_id_number && + local_income == o.local_income + 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 + [state_tax_withheld, state, state_id_number, state_income, local_tax_withheld, locality, locality_id_number, local_income].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/state_and_local_withholding_request.rb b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb new file mode 100644 index 0000000..c9519ce --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb @@ -0,0 +1,273 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class StateAndLocalWithholdingRequest + attr_accessor :state_tax_withheld + + attr_accessor :state + + attr_accessor :state_id_number + + attr_accessor :state_income + + attr_accessor :local_tax_withheld + + attr_accessor :locality + + attr_accessor :locality_id_number + + attr_accessor :local_income + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'state_tax_withheld' => :'stateTaxWithheld', + :'state' => :'state', + :'state_id_number' => :'stateIdNumber', + :'state_income' => :'stateIncome', + :'local_tax_withheld' => :'localTaxWithheld', + :'locality' => :'locality', + :'locality_id_number' => :'localityIdNumber', + :'local_income' => :'localIncome' + } + 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 + { + :'state_tax_withheld' => :'Float', + :'state' => :'String', + :'state_id_number' => :'String', + :'state_income' => :'Float', + :'local_tax_withheld' => :'Float', + :'locality' => :'String', + :'locality_id_number' => :'String', + :'local_income' => :'Float' + } + 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::A1099::V2::StateAndLocalWithholdingRequest` 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::StateAndLocalWithholdingRequest`. 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?(:'state_tax_withheld') + self.state_tax_withheld = attributes[:'state_tax_withheld'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'state_id_number') + self.state_id_number = attributes[:'state_id_number'] + end + + if attributes.key?(:'state_income') + self.state_income = attributes[:'state_income'] + end + + if attributes.key?(:'local_tax_withheld') + self.local_tax_withheld = attributes[:'local_tax_withheld'] + end + + if attributes.key?(:'locality') + self.locality = attributes[:'locality'] + end + + if attributes.key?(:'locality_id_number') + self.locality_id_number = attributes[:'locality_id_number'] + end + + if attributes.key?(:'local_income') + self.local_income = attributes[:'local_income'] + 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 && + state_tax_withheld == o.state_tax_withheld && + state == o.state && + state_id_number == o.state_id_number && + state_income == o.state_income && + local_tax_withheld == o.local_tax_withheld && + locality == o.locality && + locality_id_number == o.locality_id_number && + local_income == o.local_income + 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 + [state_tax_withheld, state, state_id_number, state_income, local_tax_withheld, locality, locality_id_number, local_income].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/state_efile_status_detail.rb b/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail.rb new file mode 100644 index 0000000..e3636cf --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail.rb @@ -0,0 +1,231 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class StateEfileStatusDetail + 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::StateEfileStatusDetail` 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::StateEfileStatusDetail`. 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/substantial_us_owner_response.rb b/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb new file mode 100644 index 0000000..805bac1 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb @@ -0,0 +1,233 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class SubstantialUsOwnerResponse + # 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::SubstantialUsOwnerResponse` 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::SubstantialUsOwnerResponse`. 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/validation_error.rb b/lib/avalara_sdk/models/A1099/V2/validation_error.rb new file mode 100644 index 0000000..df4e638 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/validation_error.rb @@ -0,0 +1,229 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class ValidationError + attr_accessor :field + + 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::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::A1099::V2::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?(:'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 new file mode 100644 index 0000000..17878e9 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb @@ -0,0 +1,2443 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # W-4 Form + class W4FormDataModel + # Type of the form, always W4 for this model. + attr_accessor :type + + # The date the form was signed. + attr_accessor :signed_date + + # The creation date of the form. + attr_accessor :created_at + + # 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 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 type of TIN provided. + attr_accessor :type_of_tin + + # The taxpayer identification number (TIN) of the employee. + attr_accessor :tin + + # The marital status of the employee. + attr_accessor :box3_marital_status + + # Indicates whether the last name differs from prior records. + attr_accessor :box4_last_name_differs + + # The number of allowances claimed by the employee. + attr_accessor :box5_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 :box6_additional_withheld + + # Indicates whether the employee is exempt from withholding. + attr_accessor :box7_exempt_from_withholding + + # The office code associated with the form. + attr_accessor :office_code + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The FATCA status for disregarded entities under Chapter 4. + attr_accessor :disregarded_entity_chapter4_fatca_status + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # 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 postal code of the residence. + attr_accessor :residence_postal_code + + # The country of residence. + attr_accessor :residence_country + + # 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 postal code of the mailing address. + attr_accessor :mailing_postal_code + + # The country of the mailing address. + attr_accessor :mailing_country + + # 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 postal code for disregarded entities. + attr_accessor :disregarded_postal_code + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # Indicates whether a foreign TIN is not required. + attr_accessor :ftin_not_required + + # A reference number for the form. + attr_accessor :reference_number + + # The global intermediary identification number (GIIN). + attr_accessor :giin + + # The Chapter 3 entity type. + attr_accessor :chapter3_entity_type + + # The Chapter 4 FATCA status. + attr_accessor :chapter4_fatca_status + + # The disregarded entity information. + attr_accessor :disregarded_entity + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # The benefit limitation for tax treaty claims. + attr_accessor :benefit_limitation + + # The sponsoring entity information for Part 4. + attr_accessor :part4_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 4. + attr_accessor :part4_sponsoring_entity_giin + + # The sponsoring entity information for Part 7. + attr_accessor :part7_sponsoring_entity + + # The IGA country information for Part 12. + attr_accessor :part12_iga_country + + # The IGA type information for Part 12. + attr_accessor :part12_iga_type + + # The FATCA status under IGA Annex II for Part 12. + attr_accessor :part12_fatca_status_under_iga_annex_ii + + # The trustee name for Part 12. + attr_accessor :part12_trustee_name + + # Indicates whether the trustee is foreign for Part 12. + attr_accessor :part12_trustee_is_foreign + + # The GIIN for Model 2 IGA in Part 12. + attr_accessor :part12_model2_iga_giin + + # The exchange information for Box 37A. + attr_accessor :box37_a_exchange + + # The exchange information for Box 37B. + attr_accessor :box37_b_exchange + + # The entity information for Box 37B. + attr_accessor :box37_b_entity + + # The sponsoring entity information for Part 28. + attr_accessor :part28_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 28. + attr_accessor :part28_sponsoring_entity_giin + + # The name of the signer of the form. + attr_accessor :signer_name + + # Indicates whether the residence address is also the mailing address. + attr_accessor :residence_is_mailing + + # The country of citizenship. + attr_accessor :citizenship_country + + attr_accessor :making_treaty_claim + + # The country for which the treaty applies. + attr_accessor :treaty_country + + # The specific article of the treaty being claimed. + attr_accessor :treaty_article + + # 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 reasons for claiming treaty benefits. + attr_accessor :treaty_reasons + + attr_accessor :certify_box14_a + + attr_accessor :certify_box14_b + + attr_accessor :certify_box14_c + + attr_accessor :certify_box17_1 + + attr_accessor :certify_box17_2 + + attr_accessor :certify_box18 + + attr_accessor :certify_box19 + + attr_accessor :certify_box21 + + # Indicates certification for box 22. + attr_accessor :certify_box22 + + attr_accessor :certify_box23 + + # Indicates certification for box 24A. + attr_accessor :certify_box24_a + + # Indicates certification for box 24B. + attr_accessor :certify_box24_b + + # Indicates certification for box 24C. + attr_accessor :certify_box24_c + + attr_accessor :certify_box24_d + + attr_accessor :certify_box25_a + + attr_accessor :certify_box25_b + + attr_accessor :certify_box25_c + + # Indicates certification for box 26. + attr_accessor :certify_box26 + + attr_accessor :certify_box27 + + attr_accessor :certify_box28_a + + attr_accessor :certify_box28_b + + attr_accessor :certify_box29_a + + attr_accessor :certify_box29_b + + attr_accessor :certify_box29_c + + attr_accessor :certify_box29_d + + attr_accessor :certify_box29_e + + attr_accessor :certify_box29_f + + attr_accessor :certify_box30 + + # Indicates certification for box 31. + attr_accessor :certify_box31 + + # Indicates certification for box 32. + attr_accessor :certify_box32 + + attr_accessor :certify_box33 + + # Indicates certification for box 34. + attr_accessor :certify_box34 + + # Indicates certification for box 35. + attr_accessor :certify_box35 + + # Indicates certification for box 36. + attr_accessor :certify_box36 + + # Indicates certification for box 37A. + attr_accessor :certify_box37_a + + # Indicates certification for box 37B. + attr_accessor :certify_box37_b + + # Indicates certification for box 38. + attr_accessor :certify_box38 + + # Indicates certification for box 39. + attr_accessor :certify_box39 + + attr_accessor :certify_box40_a + + attr_accessor :certify_box40_b + + attr_accessor :certify_box40_c + + attr_accessor :certify_box41 + + attr_accessor :certify_box43 + + attr_accessor :certify_part29_signature + + attr_accessor :part19_formation_or_resolution_date + + attr_accessor :part20_filing_date + + attr_accessor :part21_determination_date + + attr_accessor :substantial_us_owners + + # The birthday of the individual associated with the form. + attr_accessor :birthday + + # Indicates whether a foreign TIN is not required. + attr_accessor :foreign_tin_not_required + + # Indicates whether the form is archived. + attr_accessor :archived + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # The capacity in which the signer is signing the form. + attr_accessor :signer_capacity + + # The last updated date of the form. + attr_accessor :updated_at + + # The employer identification number (EIN). + attr_accessor :ein + + # The type of employer identification number (EIN). + attr_accessor :ein_type + + # Indicates certification for box 14. + attr_accessor :certify_box14 + + # Indicates certification for box 15A. + attr_accessor :certify_box15_a + + # Indicates certification for box 15B. + attr_accessor :certify_box15_b + + # Indicates certification for box 15C. + attr_accessor :certify_box15_c + + # Indicates certification for box 15D. + attr_accessor :certify_box15_d + + # Indicates certification for box 15E. + attr_accessor :certify_box15_e + + # Indicates certification for box 15F. + attr_accessor :certify_box15_f + + # Indicates certification for box 15G. + attr_accessor :certify_box15_g + + # Indicates certification for box 15H. + attr_accessor :certify_box15_h + + # Indicates certification for box 15I. + attr_accessor :certify_box15_i + + # Indicates certification for box 16A. + attr_accessor :certify_box16_a + + # Indicates certification for box 16B as a QDD corporate entity. + attr_accessor :box16_b_qdd_corporate + + # Indicates certification for box 16B as a QDD partnership. + attr_accessor :box16_b_qdd_partnership + + # Indicates certification for box 16B as a QDD disregarded entity. + attr_accessor :box16_b_qdd_disregarded_entity + + # Indicates certification for box 17A. + attr_accessor :certify_box17_a + + # Indicates certification for box 17B. + attr_accessor :certify_box17_b + + # Indicates certification for box 17C. + attr_accessor :certify_box17_c + + # Indicates certification for box 17D. + attr_accessor :certify_box17_d + + # Indicates certification for box 17E. + attr_accessor :certify_box17_e + + # Indicates certification for box 18A. + attr_accessor :certify_box18_a + + # Indicates certification for box 18B. + attr_accessor :certify_box18_b + + # Indicates certification for box 18C. + attr_accessor :certify_box18_c + + # Indicates certification for box 18D. + attr_accessor :certify_box18_d + + # Indicates certification for box 18E. + attr_accessor :certify_box18_e + + # Indicates certification for box 18F. + attr_accessor :certify_box18_f + + # Indicates certification for box 19A. + attr_accessor :certify_box19_a + + # Indicates certification for box 19B. + attr_accessor :certify_box19_b + + # Indicates certification for box 19C. + attr_accessor :certify_box19_c + + # Indicates certification for box 19D. + attr_accessor :certify_box19_d + + # Indicates certification for box 19E. + attr_accessor :certify_box19_e + + # Indicates certification for box 19F. + attr_accessor :certify_box19_f + + # Indicates certification for box 20. + attr_accessor :certify_box20 + + # Indicates certification for box 21A. + attr_accessor :certify_box21_a + + # Indicates certification for box 21B. + attr_accessor :certify_box21_b + + # Indicates certification for box 21C. + attr_accessor :certify_box21_c + + # Indicates certification for box 21D. + attr_accessor :certify_box21_d + + # Indicates certification for box 21E. + attr_accessor :certify_box21_e + + # Indicates certification for box 21F. + attr_accessor :certify_box21_f + + # The name of the sponsoring entity for box 23A. + attr_accessor :box23_a_name_sponsoring_entity + + # Indicates certification for box 23B. + attr_accessor :certify_box23_b + + # Indicates certification for box 23C. + attr_accessor :certify_box23_c + + # Indicates certification for box 25. + attr_accessor :certify_box25 + + # The name of the sponsoring entity for box 27A. + attr_accessor :box27_a_name_sponsoring_entity + + # Indicates certification for box 27B. + attr_accessor :certify_box27_b + + # Indicates certification for box 28. + attr_accessor :certify_box28 + + # Indicates certification for box 29. + attr_accessor :certify_box29 + + # Indicates certification for box 30A. + attr_accessor :certify_box30_a + + # Indicates certification for box 30B. + attr_accessor :certify_box30_b + + # Indicates certification for box 30C. + attr_accessor :certify_box30_c + + # The IGA country information for box 32. + attr_accessor :box32_iga_country + + # The IGA type information for box 32. + attr_accessor :box32_iga_type + + # The IGA treatment information for box 32. + attr_accessor :box32_iga_treated_as + + # The trustee or sponsor information for box 32. + attr_accessor :box32_trustee_or_sponsor + + # Indicates whether the trustee is foreign for box 32. + attr_accessor :box32_trustee_is_foreign + + # Indicates certification for box 33A. + attr_accessor :certify_box33_a + + # Indicates certification for box 33B. + attr_accessor :certify_box33_b + + # Indicates certification for box 33C. + attr_accessor :certify_box33_c + + # Indicates certification for box 33D. + attr_accessor :certify_box33_d + + # Indicates certification for box 33E. + attr_accessor :certify_box33_e + + # Indicates certification for box 33F. + attr_accessor :certify_box33_f + + # The securities market information for box 37A. + attr_accessor :box37_a_securities_market + + # The name of the entity for box 37B. + attr_accessor :box37_b_name_of_entity + + # The securities market information for box 37B. + attr_accessor :box37_b_securities_market + + # Indicates certification for box 40. + attr_accessor :certify_box40 + + # The sponsoring entity information for box 41. + attr_accessor :box41_sponsoring_entity + + # Indicates certification for box 42. + attr_accessor :certify_box42 + + attr_accessor :box35_formed_on_date + + attr_accessor :box36_filed_on_date + + # The status of the TIN match. + attr_accessor :tin_match_status + + # The signature itself + attr_accessor :signature + + # The classification of the business. + attr_accessor :business_classification + + # The name of the business associated with the form. + attr_accessor :business_name + + attr_accessor :business_other + + attr_accessor :exempt_payee_code + + attr_accessor :exempt_fatca_code + + # The account number associated with the form. + attr_accessor :account_number + + # Indicates whether the individual or entity is in a foreign country. + attr_accessor :foreign_country_indicator + + # The foreign address of the individual or entity. + attr_accessor :foreign_address + + # Indicates whether backup withholding applies. + attr_accessor :backup_withholding + + attr_accessor :is1099able + + # Indicates whether the individual is a foreign partner, owner, or beneficiary. + attr_accessor :foreign_partner_owner_or_beneficiary + + 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', + :'signed_date' => :'signedDate', + :'created_at' => :'createdAt', + :'employee_first_name' => :'employeeFirstName', + :'employee_middle_name' => :'employeeMiddleName', + :'employee_last_name' => :'employeeLastName', + :'employee_name_suffix' => :'employeeNameSuffix', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'box3_marital_status' => :'box3MaritalStatus', + :'box4_last_name_differs' => :'box4LastNameDiffers', + :'box5_num_allowances' => :'box5NumAllowances', + :'other_dependents' => :'otherDependents', + :'non_job_income' => :'nonJobIncome', + :'deductions' => :'deductions', + :'box6_additional_withheld' => :'box6AdditionalWithheld', + :'box7_exempt_from_withholding' => :'box7ExemptFromWithholding', + :'office_code' => :'officeCode', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'disregarded_entity_chapter4_fatca_status' => :'disregardedEntityChapter4FatcaStatus', + :'name' => :'name', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_postal_code' => :'residencePostalCode', + :'residence_country' => :'residenceCountry', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_postal_code' => :'mailingPostalCode', + :'mailing_country' => :'mailingCountry', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_postal_code' => :'disregardedPostalCode', + :'disregarded_country' => :'disregardedCountry', + :'foreign_tin' => :'foreignTin', + :'ftin_not_required' => :'ftinNotRequired', + :'reference_number' => :'referenceNumber', + :'giin' => :'giin', + :'chapter3_entity_type' => :'chapter3EntityType', + :'chapter4_fatca_status' => :'chapter4FatcaStatus', + :'disregarded_entity' => :'disregardedEntity', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'benefit_limitation' => :'benefitLimitation', + :'part4_sponsoring_entity' => :'part4SponsoringEntity', + :'part4_sponsoring_entity_giin' => :'part4SponsoringEntityGiin', + :'part7_sponsoring_entity' => :'part7SponsoringEntity', + :'part12_iga_country' => :'part12IgaCountry', + :'part12_iga_type' => :'part12IgaType', + :'part12_fatca_status_under_iga_annex_ii' => :'part12FatcaStatusUnderIgaAnnexIi', + :'part12_trustee_name' => :'part12TrusteeName', + :'part12_trustee_is_foreign' => :'part12TrusteeIsForeign', + :'part12_model2_iga_giin' => :'part12Model2IgaGiin', + :'box37_a_exchange' => :'box37AExchange', + :'box37_b_exchange' => :'box37BExchange', + :'box37_b_entity' => :'box37BEntity', + :'part28_sponsoring_entity' => :'part28SponsoringEntity', + :'part28_sponsoring_entity_giin' => :'part28SponsoringEntityGiin', + :'signer_name' => :'signerName', + :'residence_is_mailing' => :'residenceIsMailing', + :'citizenship_country' => :'citizenshipCountry', + :'making_treaty_claim' => :'makingTreatyClaim', + :'treaty_country' => :'treatyCountry', + :'treaty_article' => :'treatyArticle', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'treaty_reasons' => :'treatyReasons', + :'certify_box14_a' => :'certifyBox14A', + :'certify_box14_b' => :'certifyBox14B', + :'certify_box14_c' => :'certifyBox14C', + :'certify_box17_1' => :'certifyBox17_1', + :'certify_box17_2' => :'certifyBox17_2', + :'certify_box18' => :'certifyBox18', + :'certify_box19' => :'certifyBox19', + :'certify_box21' => :'certifyBox21', + :'certify_box22' => :'certifyBox22', + :'certify_box23' => :'certifyBox23', + :'certify_box24_a' => :'certifyBox24A', + :'certify_box24_b' => :'certifyBox24B', + :'certify_box24_c' => :'certifyBox24C', + :'certify_box24_d' => :'certifyBox24D', + :'certify_box25_a' => :'certifyBox25A', + :'certify_box25_b' => :'certifyBox25B', + :'certify_box25_c' => :'certifyBox25C', + :'certify_box26' => :'certifyBox26', + :'certify_box27' => :'certifyBox27', + :'certify_box28_a' => :'certifyBox28A', + :'certify_box28_b' => :'certifyBox28B', + :'certify_box29_a' => :'certifyBox29A', + :'certify_box29_b' => :'certifyBox29B', + :'certify_box29_c' => :'certifyBox29C', + :'certify_box29_d' => :'certifyBox29D', + :'certify_box29_e' => :'certifyBox29E', + :'certify_box29_f' => :'certifyBox29F', + :'certify_box30' => :'certifyBox30', + :'certify_box31' => :'certifyBox31', + :'certify_box32' => :'certifyBox32', + :'certify_box33' => :'certifyBox33', + :'certify_box34' => :'certifyBox34', + :'certify_box35' => :'certifyBox35', + :'certify_box36' => :'certifyBox36', + :'certify_box37_a' => :'certifyBox37A', + :'certify_box37_b' => :'certifyBox37B', + :'certify_box38' => :'certifyBox38', + :'certify_box39' => :'certifyBox39', + :'certify_box40_a' => :'certifyBox40A', + :'certify_box40_b' => :'certifyBox40B', + :'certify_box40_c' => :'certifyBox40C', + :'certify_box41' => :'certifyBox41', + :'certify_box43' => :'certifyBox43', + :'certify_part29_signature' => :'certifyPart29Signature', + :'part19_formation_or_resolution_date' => :'part19FormationOrResolutionDate', + :'part20_filing_date' => :'part20FilingDate', + :'part21_determination_date' => :'part21DeterminationDate', + :'substantial_us_owners' => :'substantialUsOwners', + :'birthday' => :'birthday', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'archived' => :'archived', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'signer_capacity' => :'signerCapacity', + :'updated_at' => :'updatedAt', + :'ein' => :'ein', + :'ein_type' => :'einType', + :'certify_box14' => :'certifyBox14', + :'certify_box15_a' => :'certifyBox15A', + :'certify_box15_b' => :'certifyBox15B', + :'certify_box15_c' => :'certifyBox15C', + :'certify_box15_d' => :'certifyBox15D', + :'certify_box15_e' => :'certifyBox15E', + :'certify_box15_f' => :'certifyBox15F', + :'certify_box15_g' => :'certifyBox15G', + :'certify_box15_h' => :'certifyBox15H', + :'certify_box15_i' => :'certifyBox15I', + :'certify_box16_a' => :'certifyBox16A', + :'box16_b_qdd_corporate' => :'box16BQddCorporate', + :'box16_b_qdd_partnership' => :'box16BQddPartnership', + :'box16_b_qdd_disregarded_entity' => :'box16BQddDisregardedEntity', + :'certify_box17_a' => :'certifyBox17A', + :'certify_box17_b' => :'certifyBox17B', + :'certify_box17_c' => :'certifyBox17C', + :'certify_box17_d' => :'certifyBox17D', + :'certify_box17_e' => :'certifyBox17E', + :'certify_box18_a' => :'certifyBox18A', + :'certify_box18_b' => :'certifyBox18B', + :'certify_box18_c' => :'certifyBox18C', + :'certify_box18_d' => :'certifyBox18D', + :'certify_box18_e' => :'certifyBox18E', + :'certify_box18_f' => :'certifyBox18F', + :'certify_box19_a' => :'certifyBox19A', + :'certify_box19_b' => :'certifyBox19B', + :'certify_box19_c' => :'certifyBox19C', + :'certify_box19_d' => :'certifyBox19D', + :'certify_box19_e' => :'certifyBox19E', + :'certify_box19_f' => :'certifyBox19F', + :'certify_box20' => :'certifyBox20', + :'certify_box21_a' => :'certifyBox21A', + :'certify_box21_b' => :'certifyBox21B', + :'certify_box21_c' => :'certifyBox21C', + :'certify_box21_d' => :'certifyBox21D', + :'certify_box21_e' => :'certifyBox21E', + :'certify_box21_f' => :'certifyBox21F', + :'box23_a_name_sponsoring_entity' => :'box23ANameSponsoringEntity', + :'certify_box23_b' => :'certifyBox23B', + :'certify_box23_c' => :'certifyBox23C', + :'certify_box25' => :'certifyBox25', + :'box27_a_name_sponsoring_entity' => :'box27ANameSponsoringEntity', + :'certify_box27_b' => :'certifyBox27B', + :'certify_box28' => :'certifyBox28', + :'certify_box29' => :'certifyBox29', + :'certify_box30_a' => :'certifyBox30A', + :'certify_box30_b' => :'certifyBox30B', + :'certify_box30_c' => :'certifyBox30C', + :'box32_iga_country' => :'box32IgaCountry', + :'box32_iga_type' => :'box32IgaType', + :'box32_iga_treated_as' => :'box32IgaTreatedAs', + :'box32_trustee_or_sponsor' => :'box32TrusteeOrSponsor', + :'box32_trustee_is_foreign' => :'box32TrusteeIsForeign', + :'certify_box33_a' => :'certifyBox33A', + :'certify_box33_b' => :'certifyBox33B', + :'certify_box33_c' => :'certifyBox33C', + :'certify_box33_d' => :'certifyBox33D', + :'certify_box33_e' => :'certifyBox33E', + :'certify_box33_f' => :'certifyBox33F', + :'box37_a_securities_market' => :'box37ASecuritiesMarket', + :'box37_b_name_of_entity' => :'box37BNameOfEntity', + :'box37_b_securities_market' => :'box37BSecuritiesMarket', + :'certify_box40' => :'certifyBox40', + :'box41_sponsoring_entity' => :'box41SponsoringEntity', + :'certify_box42' => :'certifyBox42', + :'box35_formed_on_date' => :'box35FormedOnDate', + :'box36_filed_on_date' => :'box36FiledOnDate', + :'tin_match_status' => :'tinMatchStatus', + :'signature' => :'signature', + :'business_classification' => :'businessClassification', + :'business_name' => :'businessName', + :'business_other' => :'businessOther', + :'exempt_payee_code' => :'exemptPayeeCode', + :'exempt_fatca_code' => :'exemptFatcaCode', + :'account_number' => :'accountNumber', + :'foreign_country_indicator' => :'foreignCountryIndicator', + :'foreign_address' => :'foreignAddress', + :'backup_withholding' => :'backupWithholding', + :'is1099able' => :'is1099able', + :'foreign_partner_owner_or_beneficiary' => :'foreignPartnerOwnerOrBeneficiary' + } + 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', + :'signed_date' => :'Time', + :'created_at' => :'Time', + :'employee_first_name' => :'String', + :'employee_middle_name' => :'String', + :'employee_last_name' => :'String', + :'employee_name_suffix' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'box3_marital_status' => :'String', + :'box4_last_name_differs' => :'Boolean', + :'box5_num_allowances' => :'Integer', + :'other_dependents' => :'Integer', + :'non_job_income' => :'Float', + :'deductions' => :'Float', + :'box6_additional_withheld' => :'Float', + :'box7_exempt_from_withholding' => :'Boolean', + :'office_code' => :'String', + :'e_delivery_consented_at' => :'Time', + :'disregarded_entity_chapter4_fatca_status' => :'String', + :'name' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_postal_code' => :'String', + :'residence_country' => :'String', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_postal_code' => :'String', + :'mailing_country' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_postal_code' => :'String', + :'disregarded_country' => :'String', + :'foreign_tin' => :'String', + :'ftin_not_required' => :'Boolean', + :'reference_number' => :'String', + :'giin' => :'String', + :'chapter3_entity_type' => :'String', + :'chapter4_fatca_status' => :'String', + :'disregarded_entity' => :'String', + :'disregarded_entity_giin' => :'String', + :'benefit_limitation' => :'String', + :'part4_sponsoring_entity' => :'String', + :'part4_sponsoring_entity_giin' => :'String', + :'part7_sponsoring_entity' => :'String', + :'part12_iga_country' => :'String', + :'part12_iga_type' => :'String', + :'part12_fatca_status_under_iga_annex_ii' => :'String', + :'part12_trustee_name' => :'String', + :'part12_trustee_is_foreign' => :'Boolean', + :'part12_model2_iga_giin' => :'String', + :'box37_a_exchange' => :'String', + :'box37_b_exchange' => :'String', + :'box37_b_entity' => :'String', + :'part28_sponsoring_entity' => :'String', + :'part28_sponsoring_entity_giin' => :'String', + :'signer_name' => :'String', + :'residence_is_mailing' => :'Boolean', + :'citizenship_country' => :'String', + :'making_treaty_claim' => :'Boolean', + :'treaty_country' => :'String', + :'treaty_article' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'treaty_reasons' => :'String', + :'certify_box14_a' => :'Boolean', + :'certify_box14_b' => :'Boolean', + :'certify_box14_c' => :'Boolean', + :'certify_box17_1' => :'Boolean', + :'certify_box17_2' => :'Boolean', + :'certify_box18' => :'Boolean', + :'certify_box19' => :'Boolean', + :'certify_box21' => :'Boolean', + :'certify_box22' => :'Boolean', + :'certify_box23' => :'Boolean', + :'certify_box24_a' => :'Boolean', + :'certify_box24_b' => :'Boolean', + :'certify_box24_c' => :'Boolean', + :'certify_box24_d' => :'Boolean', + :'certify_box25_a' => :'Boolean', + :'certify_box25_b' => :'Boolean', + :'certify_box25_c' => :'Boolean', + :'certify_box26' => :'Boolean', + :'certify_box27' => :'Boolean', + :'certify_box28_a' => :'Boolean', + :'certify_box28_b' => :'Boolean', + :'certify_box29_a' => :'Boolean', + :'certify_box29_b' => :'Boolean', + :'certify_box29_c' => :'Boolean', + :'certify_box29_d' => :'Boolean', + :'certify_box29_e' => :'Boolean', + :'certify_box29_f' => :'Boolean', + :'certify_box30' => :'Boolean', + :'certify_box31' => :'Boolean', + :'certify_box32' => :'Boolean', + :'certify_box33' => :'Boolean', + :'certify_box34' => :'Boolean', + :'certify_box35' => :'Boolean', + :'certify_box36' => :'Boolean', + :'certify_box37_a' => :'Boolean', + :'certify_box37_b' => :'Boolean', + :'certify_box38' => :'Boolean', + :'certify_box39' => :'Boolean', + :'certify_box40_a' => :'Boolean', + :'certify_box40_b' => :'Boolean', + :'certify_box40_c' => :'Boolean', + :'certify_box41' => :'Boolean', + :'certify_box43' => :'Boolean', + :'certify_part29_signature' => :'Boolean', + :'part19_formation_or_resolution_date' => :'Time', + :'part20_filing_date' => :'Time', + :'part21_determination_date' => :'Time', + :'substantial_us_owners' => :'Array', + :'birthday' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'archived' => :'Boolean', + :'reference_id' => :'String', + :'company_id' => :'Integer', + :'display_name' => :'String', + :'email' => :'String', + :'signer_capacity' => :'String', + :'updated_at' => :'Time', + :'ein' => :'String', + :'ein_type' => :'String', + :'certify_box14' => :'Boolean', + :'certify_box15_a' => :'Boolean', + :'certify_box15_b' => :'Boolean', + :'certify_box15_c' => :'Boolean', + :'certify_box15_d' => :'Boolean', + :'certify_box15_e' => :'Boolean', + :'certify_box15_f' => :'Boolean', + :'certify_box15_g' => :'Boolean', + :'certify_box15_h' => :'Boolean', + :'certify_box15_i' => :'Boolean', + :'certify_box16_a' => :'Boolean', + :'box16_b_qdd_corporate' => :'Boolean', + :'box16_b_qdd_partnership' => :'Boolean', + :'box16_b_qdd_disregarded_entity' => :'Boolean', + :'certify_box17_a' => :'Boolean', + :'certify_box17_b' => :'Boolean', + :'certify_box17_c' => :'Boolean', + :'certify_box17_d' => :'Boolean', + :'certify_box17_e' => :'Boolean', + :'certify_box18_a' => :'Boolean', + :'certify_box18_b' => :'Boolean', + :'certify_box18_c' => :'Boolean', + :'certify_box18_d' => :'Boolean', + :'certify_box18_e' => :'Boolean', + :'certify_box18_f' => :'Boolean', + :'certify_box19_a' => :'Boolean', + :'certify_box19_b' => :'Boolean', + :'certify_box19_c' => :'Boolean', + :'certify_box19_d' => :'Boolean', + :'certify_box19_e' => :'Boolean', + :'certify_box19_f' => :'Boolean', + :'certify_box20' => :'Boolean', + :'certify_box21_a' => :'Boolean', + :'certify_box21_b' => :'Boolean', + :'certify_box21_c' => :'Boolean', + :'certify_box21_d' => :'Boolean', + :'certify_box21_e' => :'Boolean', + :'certify_box21_f' => :'Boolean', + :'box23_a_name_sponsoring_entity' => :'String', + :'certify_box23_b' => :'Boolean', + :'certify_box23_c' => :'Boolean', + :'certify_box25' => :'Boolean', + :'box27_a_name_sponsoring_entity' => :'String', + :'certify_box27_b' => :'Boolean', + :'certify_box28' => :'Boolean', + :'certify_box29' => :'Boolean', + :'certify_box30_a' => :'Boolean', + :'certify_box30_b' => :'Boolean', + :'certify_box30_c' => :'Boolean', + :'box32_iga_country' => :'String', + :'box32_iga_type' => :'String', + :'box32_iga_treated_as' => :'String', + :'box32_trustee_or_sponsor' => :'String', + :'box32_trustee_is_foreign' => :'Boolean', + :'certify_box33_a' => :'Boolean', + :'certify_box33_b' => :'Boolean', + :'certify_box33_c' => :'Boolean', + :'certify_box33_d' => :'Boolean', + :'certify_box33_e' => :'Boolean', + :'certify_box33_f' => :'Boolean', + :'box37_a_securities_market' => :'String', + :'box37_b_name_of_entity' => :'String', + :'box37_b_securities_market' => :'String', + :'certify_box40' => :'Boolean', + :'box41_sponsoring_entity' => :'String', + :'certify_box42' => :'Boolean', + :'box35_formed_on_date' => :'Time', + :'box36_filed_on_date' => :'Time', + :'tin_match_status' => :'String', + :'signature' => :'String', + :'business_classification' => :'String', + :'business_name' => :'String', + :'business_other' => :'String', + :'exempt_payee_code' => :'String', + :'exempt_fatca_code' => :'String', + :'account_number' => :'String', + :'foreign_country_indicator' => :'Boolean', + :'foreign_address' => :'String', + :'backup_withholding' => :'Boolean', + :'is1099able' => :'Boolean', + :'foreign_partner_owner_or_beneficiary' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'signed_date', + :'created_at', + :'employee_first_name', + :'employee_middle_name', + :'employee_last_name', + :'employee_name_suffix', + :'address', + :'city', + :'state', + :'zip', + :'type_of_tin', + :'tin', + :'box3_marital_status', + :'box4_last_name_differs', + :'box5_num_allowances', + :'other_dependents', + :'non_job_income', + :'deductions', + :'box6_additional_withheld', + :'box7_exempt_from_withholding', + :'office_code', + :'e_delivery_consented_at', + :'disregarded_entity_chapter4_fatca_status', + :'name', + :'residence_address', + :'residence_city', + :'residence_state', + :'residence_postal_code', + :'residence_country', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_postal_code', + :'mailing_country', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_postal_code', + :'disregarded_country', + :'foreign_tin', + :'ftin_not_required', + :'reference_number', + :'giin', + :'chapter3_entity_type', + :'chapter4_fatca_status', + :'disregarded_entity', + :'disregarded_entity_giin', + :'benefit_limitation', + :'part4_sponsoring_entity', + :'part4_sponsoring_entity_giin', + :'part7_sponsoring_entity', + :'part12_iga_country', + :'part12_iga_type', + :'part12_fatca_status_under_iga_annex_ii', + :'part12_trustee_name', + :'part12_trustee_is_foreign', + :'part12_model2_iga_giin', + :'box37_a_exchange', + :'box37_b_exchange', + :'box37_b_entity', + :'part28_sponsoring_entity', + :'part28_sponsoring_entity_giin', + :'signer_name', + :'citizenship_country', + :'making_treaty_claim', + :'treaty_country', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'part19_formation_or_resolution_date', + :'part20_filing_date', + :'part21_determination_date', + :'birthday', + :'foreign_tin_not_required', + :'archived', + :'reference_id', + :'company_id', + :'display_name', + :'email', + :'signer_capacity', + :'updated_at', + :'ein', + :'ein_type', + :'box23_a_name_sponsoring_entity', + :'box27_a_name_sponsoring_entity', + :'box32_iga_country', + :'box32_iga_type', + :'box32_iga_treated_as', + :'box32_trustee_or_sponsor', + :'box37_a_securities_market', + :'box37_b_name_of_entity', + :'box37_b_securities_market', + :'box41_sponsoring_entity', + :'box35_formed_on_date', + :'box36_filed_on_date', + :'tin_match_status', + :'signature', + :'business_classification', + :'business_name', + :'business_other', + :'exempt_payee_code', + :'exempt_fatca_code', + :'account_number', + :'foreign_country_indicator', + :'foreign_address', + :'backup_withholding', + :'is1099able', + :'foreign_partner_owner_or_beneficiary' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'IW9FormDataModelsOneOf' + ] + 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::W4FormDataModel` 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::W4FormDataModel`. 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?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + 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?(:'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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'box3_marital_status') + self.box3_marital_status = attributes[:'box3_marital_status'] + end + + if attributes.key?(:'box4_last_name_differs') + self.box4_last_name_differs = attributes[:'box4_last_name_differs'] + end + + if attributes.key?(:'box5_num_allowances') + self.box5_num_allowances = attributes[:'box5_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?(:'box6_additional_withheld') + self.box6_additional_withheld = attributes[:'box6_additional_withheld'] + end + + if attributes.key?(:'box7_exempt_from_withholding') + self.box7_exempt_from_withholding = attributes[:'box7_exempt_from_withholding'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'disregarded_entity_chapter4_fatca_status') + self.disregarded_entity_chapter4_fatca_status = attributes[:'disregarded_entity_chapter4_fatca_status'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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_postal_code') + self.residence_postal_code = attributes[:'residence_postal_code'] + end + + if attributes.key?(:'residence_country') + self.residence_country = attributes[:'residence_country'] + 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_postal_code') + self.mailing_postal_code = attributes[:'mailing_postal_code'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + 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_postal_code') + self.disregarded_postal_code = attributes[:'disregarded_postal_code'] + end + + if attributes.key?(:'disregarded_country') + self.disregarded_country = attributes[:'disregarded_country'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'ftin_not_required') + self.ftin_not_required = attributes[:'ftin_not_required'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'chapter3_entity_type') + self.chapter3_entity_type = attributes[:'chapter3_entity_type'] + end + + if attributes.key?(:'chapter4_fatca_status') + self.chapter4_fatca_status = attributes[:'chapter4_fatca_status'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + end + + if attributes.key?(:'disregarded_entity_giin') + self.disregarded_entity_giin = attributes[:'disregarded_entity_giin'] + end + + if attributes.key?(:'benefit_limitation') + self.benefit_limitation = attributes[:'benefit_limitation'] + end + + if attributes.key?(:'part4_sponsoring_entity') + self.part4_sponsoring_entity = attributes[:'part4_sponsoring_entity'] + end + + if attributes.key?(:'part4_sponsoring_entity_giin') + self.part4_sponsoring_entity_giin = attributes[:'part4_sponsoring_entity_giin'] + end + + if attributes.key?(:'part7_sponsoring_entity') + self.part7_sponsoring_entity = attributes[:'part7_sponsoring_entity'] + end + + if attributes.key?(:'part12_iga_country') + self.part12_iga_country = attributes[:'part12_iga_country'] + end + + if attributes.key?(:'part12_iga_type') + self.part12_iga_type = attributes[:'part12_iga_type'] + end + + if attributes.key?(:'part12_fatca_status_under_iga_annex_ii') + self.part12_fatca_status_under_iga_annex_ii = attributes[:'part12_fatca_status_under_iga_annex_ii'] + end + + if attributes.key?(:'part12_trustee_name') + self.part12_trustee_name = attributes[:'part12_trustee_name'] + end + + if attributes.key?(:'part12_trustee_is_foreign') + self.part12_trustee_is_foreign = attributes[:'part12_trustee_is_foreign'] + end + + if attributes.key?(:'part12_model2_iga_giin') + self.part12_model2_iga_giin = attributes[:'part12_model2_iga_giin'] + end + + if attributes.key?(:'box37_a_exchange') + self.box37_a_exchange = attributes[:'box37_a_exchange'] + end + + if attributes.key?(:'box37_b_exchange') + self.box37_b_exchange = attributes[:'box37_b_exchange'] + end + + if attributes.key?(:'box37_b_entity') + self.box37_b_entity = attributes[:'box37_b_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity') + self.part28_sponsoring_entity = attributes[:'part28_sponsoring_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity_giin') + self.part28_sponsoring_entity_giin = attributes[:'part28_sponsoring_entity_giin'] + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'residence_is_mailing') + self.residence_is_mailing = attributes[:'residence_is_mailing'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + end + + if attributes.key?(:'making_treaty_claim') + self.making_treaty_claim = attributes[:'making_treaty_claim'] + 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?(:'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?(:'certify_box14_a') + self.certify_box14_a = attributes[:'certify_box14_a'] + end + + if attributes.key?(:'certify_box14_b') + self.certify_box14_b = attributes[:'certify_box14_b'] + end + + if attributes.key?(:'certify_box14_c') + self.certify_box14_c = attributes[:'certify_box14_c'] + end + + if attributes.key?(:'certify_box17_1') + self.certify_box17_1 = attributes[:'certify_box17_1'] + end + + if attributes.key?(:'certify_box17_2') + self.certify_box17_2 = attributes[:'certify_box17_2'] + end + + if attributes.key?(:'certify_box18') + self.certify_box18 = attributes[:'certify_box18'] + end + + if attributes.key?(:'certify_box19') + self.certify_box19 = attributes[:'certify_box19'] + end + + if attributes.key?(:'certify_box21') + self.certify_box21 = attributes[:'certify_box21'] + end + + if attributes.key?(:'certify_box22') + self.certify_box22 = attributes[:'certify_box22'] + end + + if attributes.key?(:'certify_box23') + self.certify_box23 = attributes[:'certify_box23'] + end + + if attributes.key?(:'certify_box24_a') + self.certify_box24_a = attributes[:'certify_box24_a'] + end + + if attributes.key?(:'certify_box24_b') + self.certify_box24_b = attributes[:'certify_box24_b'] + end + + if attributes.key?(:'certify_box24_c') + self.certify_box24_c = attributes[:'certify_box24_c'] + end + + if attributes.key?(:'certify_box24_d') + self.certify_box24_d = attributes[:'certify_box24_d'] + end + + if attributes.key?(:'certify_box25_a') + self.certify_box25_a = attributes[:'certify_box25_a'] + end + + if attributes.key?(:'certify_box25_b') + self.certify_box25_b = attributes[:'certify_box25_b'] + end + + if attributes.key?(:'certify_box25_c') + self.certify_box25_c = attributes[:'certify_box25_c'] + end + + if attributes.key?(:'certify_box26') + self.certify_box26 = attributes[:'certify_box26'] + end + + if attributes.key?(:'certify_box27') + self.certify_box27 = attributes[:'certify_box27'] + end + + if attributes.key?(:'certify_box28_a') + self.certify_box28_a = attributes[:'certify_box28_a'] + end + + if attributes.key?(:'certify_box28_b') + self.certify_box28_b = attributes[:'certify_box28_b'] + end + + if attributes.key?(:'certify_box29_a') + self.certify_box29_a = attributes[:'certify_box29_a'] + end + + if attributes.key?(:'certify_box29_b') + self.certify_box29_b = attributes[:'certify_box29_b'] + end + + if attributes.key?(:'certify_box29_c') + self.certify_box29_c = attributes[:'certify_box29_c'] + end + + if attributes.key?(:'certify_box29_d') + self.certify_box29_d = attributes[:'certify_box29_d'] + end + + if attributes.key?(:'certify_box29_e') + self.certify_box29_e = attributes[:'certify_box29_e'] + end + + if attributes.key?(:'certify_box29_f') + self.certify_box29_f = attributes[:'certify_box29_f'] + end + + if attributes.key?(:'certify_box30') + self.certify_box30 = attributes[:'certify_box30'] + end + + if attributes.key?(:'certify_box31') + self.certify_box31 = attributes[:'certify_box31'] + end + + if attributes.key?(:'certify_box32') + self.certify_box32 = attributes[:'certify_box32'] + end + + if attributes.key?(:'certify_box33') + self.certify_box33 = attributes[:'certify_box33'] + end + + if attributes.key?(:'certify_box34') + self.certify_box34 = attributes[:'certify_box34'] + end + + if attributes.key?(:'certify_box35') + self.certify_box35 = attributes[:'certify_box35'] + end + + if attributes.key?(:'certify_box36') + self.certify_box36 = attributes[:'certify_box36'] + end + + if attributes.key?(:'certify_box37_a') + self.certify_box37_a = attributes[:'certify_box37_a'] + end + + if attributes.key?(:'certify_box37_b') + self.certify_box37_b = attributes[:'certify_box37_b'] + end + + if attributes.key?(:'certify_box38') + self.certify_box38 = attributes[:'certify_box38'] + end + + if attributes.key?(:'certify_box39') + self.certify_box39 = attributes[:'certify_box39'] + end + + if attributes.key?(:'certify_box40_a') + self.certify_box40_a = attributes[:'certify_box40_a'] + end + + if attributes.key?(:'certify_box40_b') + self.certify_box40_b = attributes[:'certify_box40_b'] + end + + if attributes.key?(:'certify_box40_c') + self.certify_box40_c = attributes[:'certify_box40_c'] + end + + if attributes.key?(:'certify_box41') + self.certify_box41 = attributes[:'certify_box41'] + end + + if attributes.key?(:'certify_box43') + self.certify_box43 = attributes[:'certify_box43'] + end + + if attributes.key?(:'certify_part29_signature') + self.certify_part29_signature = attributes[:'certify_part29_signature'] + end + + if attributes.key?(:'part19_formation_or_resolution_date') + self.part19_formation_or_resolution_date = attributes[:'part19_formation_or_resolution_date'] + end + + if attributes.key?(:'part20_filing_date') + self.part20_filing_date = attributes[:'part20_filing_date'] + end + + if attributes.key?(:'part21_determination_date') + self.part21_determination_date = attributes[:'part21_determination_date'] + 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?(:'birthday') + self.birthday = attributes[:'birthday'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'signer_capacity') + self.signer_capacity = attributes[:'signer_capacity'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'ein_type') + self.ein_type = attributes[:'ein_type'] + end + + if attributes.key?(:'certify_box14') + self.certify_box14 = attributes[:'certify_box14'] + end + + if attributes.key?(:'certify_box15_a') + self.certify_box15_a = attributes[:'certify_box15_a'] + end + + if attributes.key?(:'certify_box15_b') + self.certify_box15_b = attributes[:'certify_box15_b'] + end + + if attributes.key?(:'certify_box15_c') + self.certify_box15_c = attributes[:'certify_box15_c'] + end + + if attributes.key?(:'certify_box15_d') + self.certify_box15_d = attributes[:'certify_box15_d'] + end + + if attributes.key?(:'certify_box15_e') + self.certify_box15_e = attributes[:'certify_box15_e'] + end + + if attributes.key?(:'certify_box15_f') + self.certify_box15_f = attributes[:'certify_box15_f'] + end + + if attributes.key?(:'certify_box15_g') + self.certify_box15_g = attributes[:'certify_box15_g'] + end + + if attributes.key?(:'certify_box15_h') + self.certify_box15_h = attributes[:'certify_box15_h'] + end + + if attributes.key?(:'certify_box15_i') + self.certify_box15_i = attributes[:'certify_box15_i'] + end + + if attributes.key?(:'certify_box16_a') + self.certify_box16_a = attributes[:'certify_box16_a'] + end + + if attributes.key?(:'box16_b_qdd_corporate') + self.box16_b_qdd_corporate = attributes[:'box16_b_qdd_corporate'] + end + + if attributes.key?(:'box16_b_qdd_partnership') + self.box16_b_qdd_partnership = attributes[:'box16_b_qdd_partnership'] + end + + if attributes.key?(:'box16_b_qdd_disregarded_entity') + self.box16_b_qdd_disregarded_entity = attributes[:'box16_b_qdd_disregarded_entity'] + end + + if attributes.key?(:'certify_box17_a') + self.certify_box17_a = attributes[:'certify_box17_a'] + end + + if attributes.key?(:'certify_box17_b') + self.certify_box17_b = attributes[:'certify_box17_b'] + end + + if attributes.key?(:'certify_box17_c') + self.certify_box17_c = attributes[:'certify_box17_c'] + end + + if attributes.key?(:'certify_box17_d') + self.certify_box17_d = attributes[:'certify_box17_d'] + end + + if attributes.key?(:'certify_box17_e') + self.certify_box17_e = attributes[:'certify_box17_e'] + end + + if attributes.key?(:'certify_box18_a') + self.certify_box18_a = attributes[:'certify_box18_a'] + end + + if attributes.key?(:'certify_box18_b') + self.certify_box18_b = attributes[:'certify_box18_b'] + end + + if attributes.key?(:'certify_box18_c') + self.certify_box18_c = attributes[:'certify_box18_c'] + end + + if attributes.key?(:'certify_box18_d') + self.certify_box18_d = attributes[:'certify_box18_d'] + end + + if attributes.key?(:'certify_box18_e') + self.certify_box18_e = attributes[:'certify_box18_e'] + end + + if attributes.key?(:'certify_box18_f') + self.certify_box18_f = attributes[:'certify_box18_f'] + end + + if attributes.key?(:'certify_box19_a') + self.certify_box19_a = attributes[:'certify_box19_a'] + end + + if attributes.key?(:'certify_box19_b') + self.certify_box19_b = attributes[:'certify_box19_b'] + end + + if attributes.key?(:'certify_box19_c') + self.certify_box19_c = attributes[:'certify_box19_c'] + end + + if attributes.key?(:'certify_box19_d') + self.certify_box19_d = attributes[:'certify_box19_d'] + end + + if attributes.key?(:'certify_box19_e') + self.certify_box19_e = attributes[:'certify_box19_e'] + end + + if attributes.key?(:'certify_box19_f') + self.certify_box19_f = attributes[:'certify_box19_f'] + end + + if attributes.key?(:'certify_box20') + self.certify_box20 = attributes[:'certify_box20'] + end + + if attributes.key?(:'certify_box21_a') + self.certify_box21_a = attributes[:'certify_box21_a'] + end + + if attributes.key?(:'certify_box21_b') + self.certify_box21_b = attributes[:'certify_box21_b'] + end + + if attributes.key?(:'certify_box21_c') + self.certify_box21_c = attributes[:'certify_box21_c'] + end + + if attributes.key?(:'certify_box21_d') + self.certify_box21_d = attributes[:'certify_box21_d'] + end + + if attributes.key?(:'certify_box21_e') + self.certify_box21_e = attributes[:'certify_box21_e'] + end + + if attributes.key?(:'certify_box21_f') + self.certify_box21_f = attributes[:'certify_box21_f'] + end + + if attributes.key?(:'box23_a_name_sponsoring_entity') + self.box23_a_name_sponsoring_entity = attributes[:'box23_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box23_b') + self.certify_box23_b = attributes[:'certify_box23_b'] + end + + if attributes.key?(:'certify_box23_c') + self.certify_box23_c = attributes[:'certify_box23_c'] + end + + if attributes.key?(:'certify_box25') + self.certify_box25 = attributes[:'certify_box25'] + end + + if attributes.key?(:'box27_a_name_sponsoring_entity') + self.box27_a_name_sponsoring_entity = attributes[:'box27_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box27_b') + self.certify_box27_b = attributes[:'certify_box27_b'] + end + + if attributes.key?(:'certify_box28') + self.certify_box28 = attributes[:'certify_box28'] + end + + if attributes.key?(:'certify_box29') + self.certify_box29 = attributes[:'certify_box29'] + end + + if attributes.key?(:'certify_box30_a') + self.certify_box30_a = attributes[:'certify_box30_a'] + end + + if attributes.key?(:'certify_box30_b') + self.certify_box30_b = attributes[:'certify_box30_b'] + end + + if attributes.key?(:'certify_box30_c') + self.certify_box30_c = attributes[:'certify_box30_c'] + end + + if attributes.key?(:'box32_iga_country') + self.box32_iga_country = attributes[:'box32_iga_country'] + end + + if attributes.key?(:'box32_iga_type') + self.box32_iga_type = attributes[:'box32_iga_type'] + end + + if attributes.key?(:'box32_iga_treated_as') + self.box32_iga_treated_as = attributes[:'box32_iga_treated_as'] + end + + if attributes.key?(:'box32_trustee_or_sponsor') + self.box32_trustee_or_sponsor = attributes[:'box32_trustee_or_sponsor'] + end + + if attributes.key?(:'box32_trustee_is_foreign') + self.box32_trustee_is_foreign = attributes[:'box32_trustee_is_foreign'] + end + + if attributes.key?(:'certify_box33_a') + self.certify_box33_a = attributes[:'certify_box33_a'] + end + + if attributes.key?(:'certify_box33_b') + self.certify_box33_b = attributes[:'certify_box33_b'] + end + + if attributes.key?(:'certify_box33_c') + self.certify_box33_c = attributes[:'certify_box33_c'] + end + + if attributes.key?(:'certify_box33_d') + self.certify_box33_d = attributes[:'certify_box33_d'] + end + + if attributes.key?(:'certify_box33_e') + self.certify_box33_e = attributes[:'certify_box33_e'] + end + + if attributes.key?(:'certify_box33_f') + self.certify_box33_f = attributes[:'certify_box33_f'] + end + + if attributes.key?(:'box37_a_securities_market') + self.box37_a_securities_market = attributes[:'box37_a_securities_market'] + end + + if attributes.key?(:'box37_b_name_of_entity') + self.box37_b_name_of_entity = attributes[:'box37_b_name_of_entity'] + end + + if attributes.key?(:'box37_b_securities_market') + self.box37_b_securities_market = attributes[:'box37_b_securities_market'] + end + + if attributes.key?(:'certify_box40') + self.certify_box40 = attributes[:'certify_box40'] + end + + if attributes.key?(:'box41_sponsoring_entity') + self.box41_sponsoring_entity = attributes[:'box41_sponsoring_entity'] + end + + if attributes.key?(:'certify_box42') + self.certify_box42 = attributes[:'certify_box42'] + end + + if attributes.key?(:'box35_formed_on_date') + self.box35_formed_on_date = attributes[:'box35_formed_on_date'] + end + + if attributes.key?(:'box36_filed_on_date') + self.box36_filed_on_date = attributes[:'box36_filed_on_date'] + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'business_classification') + self.business_classification = attributes[:'business_classification'] + end + + if attributes.key?(:'business_name') + self.business_name = attributes[:'business_name'] + end + + if attributes.key?(:'business_other') + self.business_other = attributes[:'business_other'] + 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?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'foreign_country_indicator') + self.foreign_country_indicator = attributes[:'foreign_country_indicator'] + end + + if attributes.key?(:'foreign_address') + self.foreign_address = attributes[:'foreign_address'] + 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?(:'foreign_partner_owner_or_beneficiary') + self.foreign_partner_owner_or_beneficiary = attributes[:'foreign_partner_owner_or_beneficiary'] + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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] substantial_us_owners Value to be assigned + def substantial_us_owners=(substantial_us_owners) + if substantial_us_owners.nil? + fail ArgumentError, 'substantial_us_owners cannot be nil' + end + + @substantial_us_owners = substantial_us_owners + 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 && + signed_date == o.signed_date && + created_at == o.created_at && + 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 && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + type_of_tin == o.type_of_tin && + tin == o.tin && + box3_marital_status == o.box3_marital_status && + box4_last_name_differs == o.box4_last_name_differs && + box5_num_allowances == o.box5_num_allowances && + other_dependents == o.other_dependents && + non_job_income == o.non_job_income && + deductions == o.deductions && + box6_additional_withheld == o.box6_additional_withheld && + box7_exempt_from_withholding == o.box7_exempt_from_withholding && + office_code == o.office_code && + e_delivery_consented_at == o.e_delivery_consented_at && + disregarded_entity_chapter4_fatca_status == o.disregarded_entity_chapter4_fatca_status && + name == o.name && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_postal_code == o.residence_postal_code && + residence_country == o.residence_country && + mailing_address == o.mailing_address && + mailing_city == o.mailing_city && + mailing_state == o.mailing_state && + mailing_postal_code == o.mailing_postal_code && + mailing_country == o.mailing_country && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_postal_code == o.disregarded_postal_code && + disregarded_country == o.disregarded_country && + foreign_tin == o.foreign_tin && + ftin_not_required == o.ftin_not_required && + reference_number == o.reference_number && + giin == o.giin && + chapter3_entity_type == o.chapter3_entity_type && + chapter4_fatca_status == o.chapter4_fatca_status && + disregarded_entity == o.disregarded_entity && + disregarded_entity_giin == o.disregarded_entity_giin && + benefit_limitation == o.benefit_limitation && + part4_sponsoring_entity == o.part4_sponsoring_entity && + part4_sponsoring_entity_giin == o.part4_sponsoring_entity_giin && + part7_sponsoring_entity == o.part7_sponsoring_entity && + part12_iga_country == o.part12_iga_country && + part12_iga_type == o.part12_iga_type && + part12_fatca_status_under_iga_annex_ii == o.part12_fatca_status_under_iga_annex_ii && + part12_trustee_name == o.part12_trustee_name && + part12_trustee_is_foreign == o.part12_trustee_is_foreign && + part12_model2_iga_giin == o.part12_model2_iga_giin && + box37_a_exchange == o.box37_a_exchange && + box37_b_exchange == o.box37_b_exchange && + box37_b_entity == o.box37_b_entity && + part28_sponsoring_entity == o.part28_sponsoring_entity && + part28_sponsoring_entity_giin == o.part28_sponsoring_entity_giin && + signer_name == o.signer_name && + residence_is_mailing == o.residence_is_mailing && + citizenship_country == o.citizenship_country && + making_treaty_claim == o.making_treaty_claim && + treaty_country == o.treaty_country && + treaty_article == o.treaty_article && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + treaty_reasons == o.treaty_reasons && + certify_box14_a == o.certify_box14_a && + certify_box14_b == o.certify_box14_b && + certify_box14_c == o.certify_box14_c && + certify_box17_1 == o.certify_box17_1 && + certify_box17_2 == o.certify_box17_2 && + certify_box18 == o.certify_box18 && + certify_box19 == o.certify_box19 && + certify_box21 == o.certify_box21 && + certify_box22 == o.certify_box22 && + certify_box23 == o.certify_box23 && + certify_box24_a == o.certify_box24_a && + certify_box24_b == o.certify_box24_b && + certify_box24_c == o.certify_box24_c && + certify_box24_d == o.certify_box24_d && + certify_box25_a == o.certify_box25_a && + certify_box25_b == o.certify_box25_b && + certify_box25_c == o.certify_box25_c && + certify_box26 == o.certify_box26 && + certify_box27 == o.certify_box27 && + certify_box28_a == o.certify_box28_a && + certify_box28_b == o.certify_box28_b && + certify_box29_a == o.certify_box29_a && + certify_box29_b == o.certify_box29_b && + certify_box29_c == o.certify_box29_c && + certify_box29_d == o.certify_box29_d && + certify_box29_e == o.certify_box29_e && + certify_box29_f == o.certify_box29_f && + certify_box30 == o.certify_box30 && + certify_box31 == o.certify_box31 && + certify_box32 == o.certify_box32 && + certify_box33 == o.certify_box33 && + certify_box34 == o.certify_box34 && + certify_box35 == o.certify_box35 && + certify_box36 == o.certify_box36 && + certify_box37_a == o.certify_box37_a && + certify_box37_b == o.certify_box37_b && + certify_box38 == o.certify_box38 && + certify_box39 == o.certify_box39 && + certify_box40_a == o.certify_box40_a && + certify_box40_b == o.certify_box40_b && + certify_box40_c == o.certify_box40_c && + certify_box41 == o.certify_box41 && + certify_box43 == o.certify_box43 && + certify_part29_signature == o.certify_part29_signature && + part19_formation_or_resolution_date == o.part19_formation_or_resolution_date && + part20_filing_date == o.part20_filing_date && + part21_determination_date == o.part21_determination_date && + substantial_us_owners == o.substantial_us_owners && + birthday == o.birthday && + foreign_tin_not_required == o.foreign_tin_not_required && + archived == o.archived && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + signer_capacity == o.signer_capacity && + updated_at == o.updated_at && + ein == o.ein && + ein_type == o.ein_type && + certify_box14 == o.certify_box14 && + certify_box15_a == o.certify_box15_a && + certify_box15_b == o.certify_box15_b && + certify_box15_c == o.certify_box15_c && + certify_box15_d == o.certify_box15_d && + certify_box15_e == o.certify_box15_e && + certify_box15_f == o.certify_box15_f && + certify_box15_g == o.certify_box15_g && + certify_box15_h == o.certify_box15_h && + certify_box15_i == o.certify_box15_i && + certify_box16_a == o.certify_box16_a && + box16_b_qdd_corporate == o.box16_b_qdd_corporate && + box16_b_qdd_partnership == o.box16_b_qdd_partnership && + box16_b_qdd_disregarded_entity == o.box16_b_qdd_disregarded_entity && + certify_box17_a == o.certify_box17_a && + certify_box17_b == o.certify_box17_b && + certify_box17_c == o.certify_box17_c && + certify_box17_d == o.certify_box17_d && + certify_box17_e == o.certify_box17_e && + certify_box18_a == o.certify_box18_a && + certify_box18_b == o.certify_box18_b && + certify_box18_c == o.certify_box18_c && + certify_box18_d == o.certify_box18_d && + certify_box18_e == o.certify_box18_e && + certify_box18_f == o.certify_box18_f && + certify_box19_a == o.certify_box19_a && + certify_box19_b == o.certify_box19_b && + certify_box19_c == o.certify_box19_c && + certify_box19_d == o.certify_box19_d && + certify_box19_e == o.certify_box19_e && + certify_box19_f == o.certify_box19_f && + certify_box20 == o.certify_box20 && + certify_box21_a == o.certify_box21_a && + certify_box21_b == o.certify_box21_b && + certify_box21_c == o.certify_box21_c && + certify_box21_d == o.certify_box21_d && + certify_box21_e == o.certify_box21_e && + certify_box21_f == o.certify_box21_f && + box23_a_name_sponsoring_entity == o.box23_a_name_sponsoring_entity && + certify_box23_b == o.certify_box23_b && + certify_box23_c == o.certify_box23_c && + certify_box25 == o.certify_box25 && + box27_a_name_sponsoring_entity == o.box27_a_name_sponsoring_entity && + certify_box27_b == o.certify_box27_b && + certify_box28 == o.certify_box28 && + certify_box29 == o.certify_box29 && + certify_box30_a == o.certify_box30_a && + certify_box30_b == o.certify_box30_b && + certify_box30_c == o.certify_box30_c && + box32_iga_country == o.box32_iga_country && + box32_iga_type == o.box32_iga_type && + box32_iga_treated_as == o.box32_iga_treated_as && + box32_trustee_or_sponsor == o.box32_trustee_or_sponsor && + box32_trustee_is_foreign == o.box32_trustee_is_foreign && + certify_box33_a == o.certify_box33_a && + certify_box33_b == o.certify_box33_b && + certify_box33_c == o.certify_box33_c && + certify_box33_d == o.certify_box33_d && + certify_box33_e == o.certify_box33_e && + certify_box33_f == o.certify_box33_f && + box37_a_securities_market == o.box37_a_securities_market && + box37_b_name_of_entity == o.box37_b_name_of_entity && + box37_b_securities_market == o.box37_b_securities_market && + certify_box40 == o.certify_box40 && + box41_sponsoring_entity == o.box41_sponsoring_entity && + certify_box42 == o.certify_box42 && + box35_formed_on_date == o.box35_formed_on_date && + box36_filed_on_date == o.box36_filed_on_date && + tin_match_status == o.tin_match_status && + signature == o.signature && + business_classification == o.business_classification && + business_name == o.business_name && + business_other == o.business_other && + exempt_payee_code == o.exempt_payee_code && + exempt_fatca_code == o.exempt_fatca_code && + account_number == o.account_number && + foreign_country_indicator == o.foreign_country_indicator && + foreign_address == o.foreign_address && + backup_withholding == o.backup_withholding && + is1099able == o.is1099able && + foreign_partner_owner_or_beneficiary == o.foreign_partner_owner_or_beneficiary + 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, signed_date, created_at, employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, address, city, state, zip, type_of_tin, tin, box3_marital_status, box4_last_name_differs, box5_num_allowances, other_dependents, non_job_income, deductions, box6_additional_withheld, box7_exempt_from_withholding, office_code, e_delivery_consented_at, disregarded_entity_chapter4_fatca_status, name, residence_address, residence_city, residence_state, residence_postal_code, residence_country, mailing_address, mailing_city, mailing_state, mailing_postal_code, mailing_country, disregarded_address, disregarded_city, disregarded_state, disregarded_postal_code, disregarded_country, foreign_tin, ftin_not_required, reference_number, giin, chapter3_entity_type, chapter4_fatca_status, disregarded_entity, disregarded_entity_giin, benefit_limitation, part4_sponsoring_entity, part4_sponsoring_entity_giin, part7_sponsoring_entity, part12_iga_country, part12_iga_type, part12_fatca_status_under_iga_annex_ii, part12_trustee_name, part12_trustee_is_foreign, part12_model2_iga_giin, box37_a_exchange, box37_b_exchange, box37_b_entity, part28_sponsoring_entity, part28_sponsoring_entity_giin, signer_name, residence_is_mailing, citizenship_country, making_treaty_claim, treaty_country, treaty_article, withholding_rate, income_type, treaty_reasons, certify_box14_a, certify_box14_b, certify_box14_c, certify_box17_1, certify_box17_2, certify_box18, certify_box19, certify_box21, certify_box22, certify_box23, certify_box24_a, certify_box24_b, certify_box24_c, certify_box24_d, certify_box25_a, certify_box25_b, certify_box25_c, certify_box26, certify_box27, certify_box28_a, certify_box28_b, certify_box29_a, certify_box29_b, certify_box29_c, certify_box29_d, certify_box29_e, certify_box29_f, certify_box30, certify_box31, certify_box32, certify_box33, certify_box34, certify_box35, certify_box36, certify_box37_a, certify_box37_b, certify_box38, certify_box39, certify_box40_a, certify_box40_b, certify_box40_c, certify_box41, certify_box43, certify_part29_signature, part19_formation_or_resolution_date, part20_filing_date, part21_determination_date, substantial_us_owners, birthday, foreign_tin_not_required, archived, reference_id, company_id, display_name, email, signer_capacity, updated_at, ein, ein_type, certify_box14, certify_box15_a, certify_box15_b, certify_box15_c, certify_box15_d, certify_box15_e, certify_box15_f, certify_box15_g, certify_box15_h, certify_box15_i, certify_box16_a, box16_b_qdd_corporate, box16_b_qdd_partnership, box16_b_qdd_disregarded_entity, certify_box17_a, certify_box17_b, certify_box17_c, certify_box17_d, certify_box17_e, certify_box18_a, certify_box18_b, certify_box18_c, certify_box18_d, certify_box18_e, certify_box18_f, certify_box19_a, certify_box19_b, certify_box19_c, certify_box19_d, certify_box19_e, certify_box19_f, certify_box20, certify_box21_a, certify_box21_b, certify_box21_c, certify_box21_d, certify_box21_e, certify_box21_f, box23_a_name_sponsoring_entity, certify_box23_b, certify_box23_c, certify_box25, box27_a_name_sponsoring_entity, certify_box27_b, certify_box28, certify_box29, certify_box30_a, certify_box30_b, certify_box30_c, box32_iga_country, box32_iga_type, box32_iga_treated_as, box32_trustee_or_sponsor, box32_trustee_is_foreign, certify_box33_a, certify_box33_b, certify_box33_c, certify_box33_d, certify_box33_e, certify_box33_f, box37_a_securities_market, box37_b_name_of_entity, box37_b_securities_market, certify_box40, box41_sponsoring_entity, certify_box42, box35_formed_on_date, box36_filed_on_date, tin_match_status, signature, business_classification, business_name, business_other, exempt_payee_code, exempt_fatca_code, account_number, foreign_country_indicator, foreign_address, backup_withholding, is1099able, foreign_partner_owner_or_beneficiary].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 new file mode 100644 index 0000000..e437c9f --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb @@ -0,0 +1,557 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W4FormResponse + # 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 unique identifier for the form. + attr_accessor :id + + # The form type. + attr_accessor :type + + # The form status. + attr_accessor :entry_status + + # The timestamp for the latest status update. + attr_accessor :entry_status_date + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # Indicates whether the form is archived. + attr_accessor :archived + + # The signature of the form. + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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', + :'id' => :'id', + :'type' => :'type', + :'entry_status' => :'entryStatus', + :'entry_status_date' => :'entryStatusDate', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'archived' => :'archived', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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 + { + :'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', + :'id' => :'String', + :'type' => :'String', + :'entry_status' => :'String', + :'entry_status_date' => :'Time', + :'reference_id' => :'String', + :'company_id' => :'String', + :'display_name' => :'String', + :'email' => :'String', + :'archived' => :'Boolean', + :'signature' => :'String', + :'signed_date' => :'Time', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + 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', + :'entry_status_date', + :'reference_id', + :'email', + :'signature', + :'signed_date', + :'e_delivery_consented_at', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseResponse' + ] + 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::W4FormResponse` 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::W4FormResponse`. 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?(:'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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'entry_status') + self.entry_status = attributes[:'entry_status'] + end + + if attributes.key?(:'entry_status_date') + self.entry_status_date = attributes[:'entry_status_date'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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 + 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 && + 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 && + id == o.id && + type == o.type && + entry_status == o.entry_status && + entry_status_date == o.entry_status_date && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + archived == o.archived && + signature == o.signature && + signed_date == o.signed_date && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at + 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 + [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, id, type, entry_status, entry_status_date, reference_id, company_id, display_name, email, archived, signature, signed_date, e_delivery_consented_at, created_at, updated_at].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 new file mode 100644 index 0000000..80517f5 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb @@ -0,0 +1,1356 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8BenEFormResponse + # 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 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 + + # 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 unique identifier for the form. + attr_accessor :id + + # The form type. + attr_accessor :type + + # The form status. + attr_accessor :entry_status + + # The timestamp for the latest status update. + attr_accessor :entry_status_date + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # Indicates whether the form is archived. + attr_accessor :archived + + # The signature of the form. + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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_type' => :'tinType', + :'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', + :'id' => :'id', + :'type' => :'type', + :'entry_status' => :'entryStatus', + :'entry_status_date' => :'entryStatusDate', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'archived' => :'archived', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'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_type' => :'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' => :'Time', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'Boolean', + :'nonfinancial_entity_filing_date' => :'Time', + :'section501_c_organization_certification' => :'Boolean', + :'determination_letter_date' => :'Time', + :'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', + :'id' => :'String', + :'type' => :'String', + :'entry_status' => :'String', + :'entry_status_date' => :'Time', + :'reference_id' => :'String', + :'company_id' => :'String', + :'display_name' => :'String', + :'email' => :'String', + :'archived' => :'Boolean', + :'signature' => :'String', + :'signed_date' => :'Time', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + 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', + :'treaty_country', + :'benefit_limitation', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'ffi_sponsoring_entity', + :'sponsored_closely_held_entity_sponsoring_entity', + :'iga_country', + :'iga_model', + :'iga_legal_status_treatment', + :'iga_ffi_trustee_or_sponsor', + :'iga_ffi_trustee_is_foreign', + :'startup_formation_or_resolution_date', + :'nonfinancial_entity_filing_date', + :'determination_letter_date', + :'publicly_traded_nffe_securities_market', + :'publicly_traded_entity', + :'nffe_affiliate_of_publicly_traded_entity_securities_market', + :'direct_reporting_nffe_sponsoring_entity', + :'signer_name', + :'entry_status_date', + :'reference_id', + :'email', + :'signature', + :'signed_date', + :'e_delivery_consented_at', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseResponse' + ] + 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::W8BenEFormResponse` 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::W8BenEFormResponse`. 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?(:'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_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_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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'entry_status') + self.entry_status = attributes[:'entry_status'] + end + + if attributes.key?(:'entry_status_date') + self.entry_status_date = attributes[:'entry_status_date'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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 + 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 && + 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_type == o.tin_type && + 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 && + id == o.id && + type == o.type && + entry_status == o.entry_status && + entry_status_date == o.entry_status_date && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + archived == o.archived && + signature == o.signature && + signed_date == o.signed_date && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at + 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, 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_type, 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, id, type, entry_status, entry_status_date, reference_id, company_id, display_name, email, archived, signature, signed_date, e_delivery_consented_at, created_at, updated_at].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_substantial_us_owner_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb new file mode 100644 index 0000000..9cb0f30 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb @@ -0,0 +1,231 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8BenESubstantialUsOwnerDataModel + attr_accessor :name + + attr_accessor :address + + 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([ + :'name', + :'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::W8BenESubstantialUsOwnerDataModel` 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::W8BenESubstantialUsOwnerDataModel`. 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/w8_ben_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb new file mode 100644 index 0000000..a63c633 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb @@ -0,0 +1,2442 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # W-8 BEN form + class W8BenFormDataModel + # Type of the form, always W8ben for this model. + attr_accessor :type + + # The date the form was signed. + attr_accessor :signed_date + + # The birthday of the individual associated with the form. + attr_accessor :birthday + + # Indicates whether a foreign TIN is not required. + attr_accessor :foreign_tin_not_required + + # Indicates whether the form is archived. + attr_accessor :archived + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # The type of TIN provided. + attr_accessor :type_of_tin + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # 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 postal code of the residence. + attr_accessor :residence_postal_code + + # The country of residence. + attr_accessor :residence_country + + 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 postal code of the mailing address. + attr_accessor :mailing_postal_code + + # The country of the mailing address. + attr_accessor :mailing_country + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # A reference number for the form. + attr_accessor :reference_number + + # The country of citizenship. + attr_accessor :citizenship_country + + # The country for which the treaty applies. + attr_accessor :treaty_country + + # The specific article of the treaty being claimed. + attr_accessor :treaty_article + + # 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 reasons for claiming treaty benefits. + attr_accessor :treaty_reasons + + # The name of the signer of the form. + attr_accessor :signer_name + + # The capacity in which the signer is signing the form. + attr_accessor :signer_capacity + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # 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 address of the individual or entity. + attr_accessor :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 marital status of the employee. + attr_accessor :box3_marital_status + + # Indicates whether the last name differs from prior records. + attr_accessor :box4_last_name_differs + + # The number of allowances claimed by the employee. + attr_accessor :box5_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 :box6_additional_withheld + + # Indicates whether the employee is exempt from withholding. + attr_accessor :box7_exempt_from_withholding + + # The office code associated with the form. + attr_accessor :office_code + + # The FATCA status for disregarded entities under Chapter 4. + attr_accessor :disregarded_entity_chapter4_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 postal code for disregarded entities. + attr_accessor :disregarded_postal_code + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # Indicates whether a foreign TIN is not required. + attr_accessor :ftin_not_required + + # The global intermediary identification number (GIIN). + attr_accessor :giin + + # The Chapter 3 entity type. + attr_accessor :chapter3_entity_type + + # The Chapter 4 FATCA status. + attr_accessor :chapter4_fatca_status + + # The disregarded entity information. + attr_accessor :disregarded_entity + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # The benefit limitation for tax treaty claims. + attr_accessor :benefit_limitation + + # The sponsoring entity information for Part 4. + attr_accessor :part4_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 4. + attr_accessor :part4_sponsoring_entity_giin + + # The sponsoring entity information for Part 7. + attr_accessor :part7_sponsoring_entity + + # The IGA country information for Part 12. + attr_accessor :part12_iga_country + + # The IGA type information for Part 12. + attr_accessor :part12_iga_type + + # The FATCA status under IGA Annex II for Part 12. + attr_accessor :part12_fatca_status_under_iga_annex_ii + + # The trustee name for Part 12. + attr_accessor :part12_trustee_name + + # Indicates whether the trustee is foreign for Part 12. + attr_accessor :part12_trustee_is_foreign + + # The GIIN for Model 2 IGA in Part 12. + attr_accessor :part12_model2_iga_giin + + # The exchange information for Box 37A. + attr_accessor :box37_a_exchange + + # The exchange information for Box 37B. + attr_accessor :box37_b_exchange + + # The entity information for Box 37B. + attr_accessor :box37_b_entity + + # The sponsoring entity information for Part 28. + attr_accessor :part28_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 28. + attr_accessor :part28_sponsoring_entity_giin + + attr_accessor :making_treaty_claim + + attr_accessor :certify_box14_a + + attr_accessor :certify_box14_b + + attr_accessor :certify_box14_c + + attr_accessor :certify_box17_1 + + attr_accessor :certify_box17_2 + + attr_accessor :certify_box18 + + attr_accessor :certify_box19 + + attr_accessor :certify_box21 + + # Indicates certification for box 22. + attr_accessor :certify_box22 + + attr_accessor :certify_box23 + + # Indicates certification for box 24A. + attr_accessor :certify_box24_a + + # Indicates certification for box 24B. + attr_accessor :certify_box24_b + + # Indicates certification for box 24C. + attr_accessor :certify_box24_c + + attr_accessor :certify_box24_d + + attr_accessor :certify_box25_a + + attr_accessor :certify_box25_b + + attr_accessor :certify_box25_c + + # Indicates certification for box 26. + attr_accessor :certify_box26 + + attr_accessor :certify_box27 + + attr_accessor :certify_box28_a + + attr_accessor :certify_box28_b + + attr_accessor :certify_box29_a + + attr_accessor :certify_box29_b + + attr_accessor :certify_box29_c + + attr_accessor :certify_box29_d + + attr_accessor :certify_box29_e + + attr_accessor :certify_box29_f + + attr_accessor :certify_box30 + + # Indicates certification for box 31. + attr_accessor :certify_box31 + + # Indicates certification for box 32. + attr_accessor :certify_box32 + + attr_accessor :certify_box33 + + # Indicates certification for box 34. + attr_accessor :certify_box34 + + # Indicates certification for box 35. + attr_accessor :certify_box35 + + # Indicates certification for box 36. + attr_accessor :certify_box36 + + # Indicates certification for box 37A. + attr_accessor :certify_box37_a + + # Indicates certification for box 37B. + attr_accessor :certify_box37_b + + # Indicates certification for box 38. + attr_accessor :certify_box38 + + # Indicates certification for box 39. + attr_accessor :certify_box39 + + attr_accessor :certify_box40_a + + attr_accessor :certify_box40_b + + attr_accessor :certify_box40_c + + attr_accessor :certify_box41 + + attr_accessor :certify_box43 + + attr_accessor :certify_part29_signature + + attr_accessor :part19_formation_or_resolution_date + + attr_accessor :part20_filing_date + + attr_accessor :part21_determination_date + + attr_accessor :substantial_us_owners + + # The employer identification number (EIN). + attr_accessor :ein + + # The type of employer identification number (EIN). + attr_accessor :ein_type + + # Indicates certification for box 14. + attr_accessor :certify_box14 + + # Indicates certification for box 15A. + attr_accessor :certify_box15_a + + # Indicates certification for box 15B. + attr_accessor :certify_box15_b + + # Indicates certification for box 15C. + attr_accessor :certify_box15_c + + # Indicates certification for box 15D. + attr_accessor :certify_box15_d + + # Indicates certification for box 15E. + attr_accessor :certify_box15_e + + # Indicates certification for box 15F. + attr_accessor :certify_box15_f + + # Indicates certification for box 15G. + attr_accessor :certify_box15_g + + # Indicates certification for box 15H. + attr_accessor :certify_box15_h + + # Indicates certification for box 15I. + attr_accessor :certify_box15_i + + # Indicates certification for box 16A. + attr_accessor :certify_box16_a + + # Indicates certification for box 16B as a QDD corporate entity. + attr_accessor :box16_b_qdd_corporate + + # Indicates certification for box 16B as a QDD partnership. + attr_accessor :box16_b_qdd_partnership + + # Indicates certification for box 16B as a QDD disregarded entity. + attr_accessor :box16_b_qdd_disregarded_entity + + # Indicates certification for box 17A. + attr_accessor :certify_box17_a + + # Indicates certification for box 17B. + attr_accessor :certify_box17_b + + # Indicates certification for box 17C. + attr_accessor :certify_box17_c + + # Indicates certification for box 17D. + attr_accessor :certify_box17_d + + # Indicates certification for box 17E. + attr_accessor :certify_box17_e + + # Indicates certification for box 18A. + attr_accessor :certify_box18_a + + # Indicates certification for box 18B. + attr_accessor :certify_box18_b + + # Indicates certification for box 18C. + attr_accessor :certify_box18_c + + # Indicates certification for box 18D. + attr_accessor :certify_box18_d + + # Indicates certification for box 18E. + attr_accessor :certify_box18_e + + # Indicates certification for box 18F. + attr_accessor :certify_box18_f + + # Indicates certification for box 19A. + attr_accessor :certify_box19_a + + # Indicates certification for box 19B. + attr_accessor :certify_box19_b + + # Indicates certification for box 19C. + attr_accessor :certify_box19_c + + # Indicates certification for box 19D. + attr_accessor :certify_box19_d + + # Indicates certification for box 19E. + attr_accessor :certify_box19_e + + # Indicates certification for box 19F. + attr_accessor :certify_box19_f + + # Indicates certification for box 20. + attr_accessor :certify_box20 + + # Indicates certification for box 21A. + attr_accessor :certify_box21_a + + # Indicates certification for box 21B. + attr_accessor :certify_box21_b + + # Indicates certification for box 21C. + attr_accessor :certify_box21_c + + # Indicates certification for box 21D. + attr_accessor :certify_box21_d + + # Indicates certification for box 21E. + attr_accessor :certify_box21_e + + # Indicates certification for box 21F. + attr_accessor :certify_box21_f + + # The name of the sponsoring entity for box 23A. + attr_accessor :box23_a_name_sponsoring_entity + + # Indicates certification for box 23B. + attr_accessor :certify_box23_b + + # Indicates certification for box 23C. + attr_accessor :certify_box23_c + + # Indicates certification for box 25. + attr_accessor :certify_box25 + + # The name of the sponsoring entity for box 27A. + attr_accessor :box27_a_name_sponsoring_entity + + # Indicates certification for box 27B. + attr_accessor :certify_box27_b + + # Indicates certification for box 28. + attr_accessor :certify_box28 + + # Indicates certification for box 29. + attr_accessor :certify_box29 + + # Indicates certification for box 30A. + attr_accessor :certify_box30_a + + # Indicates certification for box 30B. + attr_accessor :certify_box30_b + + # Indicates certification for box 30C. + attr_accessor :certify_box30_c + + # The IGA country information for box 32. + attr_accessor :box32_iga_country + + # The IGA type information for box 32. + attr_accessor :box32_iga_type + + # The IGA treatment information for box 32. + attr_accessor :box32_iga_treated_as + + # The trustee or sponsor information for box 32. + attr_accessor :box32_trustee_or_sponsor + + # Indicates whether the trustee is foreign for box 32. + attr_accessor :box32_trustee_is_foreign + + # Indicates certification for box 33A. + attr_accessor :certify_box33_a + + # Indicates certification for box 33B. + attr_accessor :certify_box33_b + + # Indicates certification for box 33C. + attr_accessor :certify_box33_c + + # Indicates certification for box 33D. + attr_accessor :certify_box33_d + + # Indicates certification for box 33E. + attr_accessor :certify_box33_e + + # Indicates certification for box 33F. + attr_accessor :certify_box33_f + + # The securities market information for box 37A. + attr_accessor :box37_a_securities_market + + # The name of the entity for box 37B. + attr_accessor :box37_b_name_of_entity + + # The securities market information for box 37B. + attr_accessor :box37_b_securities_market + + # Indicates certification for box 40. + attr_accessor :certify_box40 + + # The sponsoring entity information for box 41. + attr_accessor :box41_sponsoring_entity + + # Indicates certification for box 42. + attr_accessor :certify_box42 + + attr_accessor :box35_formed_on_date + + attr_accessor :box36_filed_on_date + + # The status of the TIN match. + attr_accessor :tin_match_status + + # The signature itself + attr_accessor :signature + + # The classification of the business. + attr_accessor :business_classification + + # The name of the business associated with the form. + attr_accessor :business_name + + attr_accessor :business_other + + attr_accessor :exempt_payee_code + + attr_accessor :exempt_fatca_code + + # The account number associated with the form. + attr_accessor :account_number + + # Indicates whether the individual or entity is in a foreign country. + attr_accessor :foreign_country_indicator + + # The foreign address of the individual or entity. + attr_accessor :foreign_address + + # Indicates whether backup withholding applies. + attr_accessor :backup_withholding + + attr_accessor :is1099able + + # Indicates whether the individual is a foreign partner, owner, or beneficiary. + attr_accessor :foreign_partner_owner_or_beneficiary + + 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', + :'signed_date' => :'signedDate', + :'birthday' => :'birthday', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'archived' => :'archived', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'type_of_tin' => :'typeOfTin', + :'name' => :'name', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_postal_code' => :'residencePostalCode', + :'residence_country' => :'residenceCountry', + :'residence_is_mailing' => :'residenceIsMailing', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_postal_code' => :'mailingPostalCode', + :'mailing_country' => :'mailingCountry', + :'tin' => :'tin', + :'foreign_tin' => :'foreignTin', + :'reference_number' => :'referenceNumber', + :'citizenship_country' => :'citizenshipCountry', + :'treaty_country' => :'treatyCountry', + :'treaty_article' => :'treatyArticle', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'treaty_reasons' => :'treatyReasons', + :'signer_name' => :'signerName', + :'signer_capacity' => :'signerCapacity', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'employee_first_name' => :'employeeFirstName', + :'employee_middle_name' => :'employeeMiddleName', + :'employee_last_name' => :'employeeLastName', + :'employee_name_suffix' => :'employeeNameSuffix', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'box3_marital_status' => :'box3MaritalStatus', + :'box4_last_name_differs' => :'box4LastNameDiffers', + :'box5_num_allowances' => :'box5NumAllowances', + :'other_dependents' => :'otherDependents', + :'non_job_income' => :'nonJobIncome', + :'deductions' => :'deductions', + :'box6_additional_withheld' => :'box6AdditionalWithheld', + :'box7_exempt_from_withholding' => :'box7ExemptFromWithholding', + :'office_code' => :'officeCode', + :'disregarded_entity_chapter4_fatca_status' => :'disregardedEntityChapter4FatcaStatus', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_postal_code' => :'disregardedPostalCode', + :'disregarded_country' => :'disregardedCountry', + :'ftin_not_required' => :'ftinNotRequired', + :'giin' => :'giin', + :'chapter3_entity_type' => :'chapter3EntityType', + :'chapter4_fatca_status' => :'chapter4FatcaStatus', + :'disregarded_entity' => :'disregardedEntity', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'benefit_limitation' => :'benefitLimitation', + :'part4_sponsoring_entity' => :'part4SponsoringEntity', + :'part4_sponsoring_entity_giin' => :'part4SponsoringEntityGiin', + :'part7_sponsoring_entity' => :'part7SponsoringEntity', + :'part12_iga_country' => :'part12IgaCountry', + :'part12_iga_type' => :'part12IgaType', + :'part12_fatca_status_under_iga_annex_ii' => :'part12FatcaStatusUnderIgaAnnexIi', + :'part12_trustee_name' => :'part12TrusteeName', + :'part12_trustee_is_foreign' => :'part12TrusteeIsForeign', + :'part12_model2_iga_giin' => :'part12Model2IgaGiin', + :'box37_a_exchange' => :'box37AExchange', + :'box37_b_exchange' => :'box37BExchange', + :'box37_b_entity' => :'box37BEntity', + :'part28_sponsoring_entity' => :'part28SponsoringEntity', + :'part28_sponsoring_entity_giin' => :'part28SponsoringEntityGiin', + :'making_treaty_claim' => :'makingTreatyClaim', + :'certify_box14_a' => :'certifyBox14A', + :'certify_box14_b' => :'certifyBox14B', + :'certify_box14_c' => :'certifyBox14C', + :'certify_box17_1' => :'certifyBox17_1', + :'certify_box17_2' => :'certifyBox17_2', + :'certify_box18' => :'certifyBox18', + :'certify_box19' => :'certifyBox19', + :'certify_box21' => :'certifyBox21', + :'certify_box22' => :'certifyBox22', + :'certify_box23' => :'certifyBox23', + :'certify_box24_a' => :'certifyBox24A', + :'certify_box24_b' => :'certifyBox24B', + :'certify_box24_c' => :'certifyBox24C', + :'certify_box24_d' => :'certifyBox24D', + :'certify_box25_a' => :'certifyBox25A', + :'certify_box25_b' => :'certifyBox25B', + :'certify_box25_c' => :'certifyBox25C', + :'certify_box26' => :'certifyBox26', + :'certify_box27' => :'certifyBox27', + :'certify_box28_a' => :'certifyBox28A', + :'certify_box28_b' => :'certifyBox28B', + :'certify_box29_a' => :'certifyBox29A', + :'certify_box29_b' => :'certifyBox29B', + :'certify_box29_c' => :'certifyBox29C', + :'certify_box29_d' => :'certifyBox29D', + :'certify_box29_e' => :'certifyBox29E', + :'certify_box29_f' => :'certifyBox29F', + :'certify_box30' => :'certifyBox30', + :'certify_box31' => :'certifyBox31', + :'certify_box32' => :'certifyBox32', + :'certify_box33' => :'certifyBox33', + :'certify_box34' => :'certifyBox34', + :'certify_box35' => :'certifyBox35', + :'certify_box36' => :'certifyBox36', + :'certify_box37_a' => :'certifyBox37A', + :'certify_box37_b' => :'certifyBox37B', + :'certify_box38' => :'certifyBox38', + :'certify_box39' => :'certifyBox39', + :'certify_box40_a' => :'certifyBox40A', + :'certify_box40_b' => :'certifyBox40B', + :'certify_box40_c' => :'certifyBox40C', + :'certify_box41' => :'certifyBox41', + :'certify_box43' => :'certifyBox43', + :'certify_part29_signature' => :'certifyPart29Signature', + :'part19_formation_or_resolution_date' => :'part19FormationOrResolutionDate', + :'part20_filing_date' => :'part20FilingDate', + :'part21_determination_date' => :'part21DeterminationDate', + :'substantial_us_owners' => :'substantialUsOwners', + :'ein' => :'ein', + :'ein_type' => :'einType', + :'certify_box14' => :'certifyBox14', + :'certify_box15_a' => :'certifyBox15A', + :'certify_box15_b' => :'certifyBox15B', + :'certify_box15_c' => :'certifyBox15C', + :'certify_box15_d' => :'certifyBox15D', + :'certify_box15_e' => :'certifyBox15E', + :'certify_box15_f' => :'certifyBox15F', + :'certify_box15_g' => :'certifyBox15G', + :'certify_box15_h' => :'certifyBox15H', + :'certify_box15_i' => :'certifyBox15I', + :'certify_box16_a' => :'certifyBox16A', + :'box16_b_qdd_corporate' => :'box16BQddCorporate', + :'box16_b_qdd_partnership' => :'box16BQddPartnership', + :'box16_b_qdd_disregarded_entity' => :'box16BQddDisregardedEntity', + :'certify_box17_a' => :'certifyBox17A', + :'certify_box17_b' => :'certifyBox17B', + :'certify_box17_c' => :'certifyBox17C', + :'certify_box17_d' => :'certifyBox17D', + :'certify_box17_e' => :'certifyBox17E', + :'certify_box18_a' => :'certifyBox18A', + :'certify_box18_b' => :'certifyBox18B', + :'certify_box18_c' => :'certifyBox18C', + :'certify_box18_d' => :'certifyBox18D', + :'certify_box18_e' => :'certifyBox18E', + :'certify_box18_f' => :'certifyBox18F', + :'certify_box19_a' => :'certifyBox19A', + :'certify_box19_b' => :'certifyBox19B', + :'certify_box19_c' => :'certifyBox19C', + :'certify_box19_d' => :'certifyBox19D', + :'certify_box19_e' => :'certifyBox19E', + :'certify_box19_f' => :'certifyBox19F', + :'certify_box20' => :'certifyBox20', + :'certify_box21_a' => :'certifyBox21A', + :'certify_box21_b' => :'certifyBox21B', + :'certify_box21_c' => :'certifyBox21C', + :'certify_box21_d' => :'certifyBox21D', + :'certify_box21_e' => :'certifyBox21E', + :'certify_box21_f' => :'certifyBox21F', + :'box23_a_name_sponsoring_entity' => :'box23ANameSponsoringEntity', + :'certify_box23_b' => :'certifyBox23B', + :'certify_box23_c' => :'certifyBox23C', + :'certify_box25' => :'certifyBox25', + :'box27_a_name_sponsoring_entity' => :'box27ANameSponsoringEntity', + :'certify_box27_b' => :'certifyBox27B', + :'certify_box28' => :'certifyBox28', + :'certify_box29' => :'certifyBox29', + :'certify_box30_a' => :'certifyBox30A', + :'certify_box30_b' => :'certifyBox30B', + :'certify_box30_c' => :'certifyBox30C', + :'box32_iga_country' => :'box32IgaCountry', + :'box32_iga_type' => :'box32IgaType', + :'box32_iga_treated_as' => :'box32IgaTreatedAs', + :'box32_trustee_or_sponsor' => :'box32TrusteeOrSponsor', + :'box32_trustee_is_foreign' => :'box32TrusteeIsForeign', + :'certify_box33_a' => :'certifyBox33A', + :'certify_box33_b' => :'certifyBox33B', + :'certify_box33_c' => :'certifyBox33C', + :'certify_box33_d' => :'certifyBox33D', + :'certify_box33_e' => :'certifyBox33E', + :'certify_box33_f' => :'certifyBox33F', + :'box37_a_securities_market' => :'box37ASecuritiesMarket', + :'box37_b_name_of_entity' => :'box37BNameOfEntity', + :'box37_b_securities_market' => :'box37BSecuritiesMarket', + :'certify_box40' => :'certifyBox40', + :'box41_sponsoring_entity' => :'box41SponsoringEntity', + :'certify_box42' => :'certifyBox42', + :'box35_formed_on_date' => :'box35FormedOnDate', + :'box36_filed_on_date' => :'box36FiledOnDate', + :'tin_match_status' => :'tinMatchStatus', + :'signature' => :'signature', + :'business_classification' => :'businessClassification', + :'business_name' => :'businessName', + :'business_other' => :'businessOther', + :'exempt_payee_code' => :'exemptPayeeCode', + :'exempt_fatca_code' => :'exemptFatcaCode', + :'account_number' => :'accountNumber', + :'foreign_country_indicator' => :'foreignCountryIndicator', + :'foreign_address' => :'foreignAddress', + :'backup_withholding' => :'backupWithholding', + :'is1099able' => :'is1099able', + :'foreign_partner_owner_or_beneficiary' => :'foreignPartnerOwnerOrBeneficiary' + } + 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', + :'signed_date' => :'Time', + :'birthday' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'archived' => :'Boolean', + :'reference_id' => :'String', + :'company_id' => :'Integer', + :'display_name' => :'String', + :'email' => :'String', + :'type_of_tin' => :'String', + :'name' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_postal_code' => :'String', + :'residence_country' => :'String', + :'residence_is_mailing' => :'Boolean', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_postal_code' => :'String', + :'mailing_country' => :'String', + :'tin' => :'String', + :'foreign_tin' => :'String', + :'reference_number' => :'String', + :'citizenship_country' => :'String', + :'treaty_country' => :'String', + :'treaty_article' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'treaty_reasons' => :'String', + :'signer_name' => :'String', + :'signer_capacity' => :'String', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'employee_first_name' => :'String', + :'employee_middle_name' => :'String', + :'employee_last_name' => :'String', + :'employee_name_suffix' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'box3_marital_status' => :'String', + :'box4_last_name_differs' => :'Boolean', + :'box5_num_allowances' => :'Integer', + :'other_dependents' => :'Integer', + :'non_job_income' => :'Float', + :'deductions' => :'Float', + :'box6_additional_withheld' => :'Float', + :'box7_exempt_from_withholding' => :'Boolean', + :'office_code' => :'String', + :'disregarded_entity_chapter4_fatca_status' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_postal_code' => :'String', + :'disregarded_country' => :'String', + :'ftin_not_required' => :'Boolean', + :'giin' => :'String', + :'chapter3_entity_type' => :'String', + :'chapter4_fatca_status' => :'String', + :'disregarded_entity' => :'String', + :'disregarded_entity_giin' => :'String', + :'benefit_limitation' => :'String', + :'part4_sponsoring_entity' => :'String', + :'part4_sponsoring_entity_giin' => :'String', + :'part7_sponsoring_entity' => :'String', + :'part12_iga_country' => :'String', + :'part12_iga_type' => :'String', + :'part12_fatca_status_under_iga_annex_ii' => :'String', + :'part12_trustee_name' => :'String', + :'part12_trustee_is_foreign' => :'Boolean', + :'part12_model2_iga_giin' => :'String', + :'box37_a_exchange' => :'String', + :'box37_b_exchange' => :'String', + :'box37_b_entity' => :'String', + :'part28_sponsoring_entity' => :'String', + :'part28_sponsoring_entity_giin' => :'String', + :'making_treaty_claim' => :'Boolean', + :'certify_box14_a' => :'Boolean', + :'certify_box14_b' => :'Boolean', + :'certify_box14_c' => :'Boolean', + :'certify_box17_1' => :'Boolean', + :'certify_box17_2' => :'Boolean', + :'certify_box18' => :'Boolean', + :'certify_box19' => :'Boolean', + :'certify_box21' => :'Boolean', + :'certify_box22' => :'Boolean', + :'certify_box23' => :'Boolean', + :'certify_box24_a' => :'Boolean', + :'certify_box24_b' => :'Boolean', + :'certify_box24_c' => :'Boolean', + :'certify_box24_d' => :'Boolean', + :'certify_box25_a' => :'Boolean', + :'certify_box25_b' => :'Boolean', + :'certify_box25_c' => :'Boolean', + :'certify_box26' => :'Boolean', + :'certify_box27' => :'Boolean', + :'certify_box28_a' => :'Boolean', + :'certify_box28_b' => :'Boolean', + :'certify_box29_a' => :'Boolean', + :'certify_box29_b' => :'Boolean', + :'certify_box29_c' => :'Boolean', + :'certify_box29_d' => :'Boolean', + :'certify_box29_e' => :'Boolean', + :'certify_box29_f' => :'Boolean', + :'certify_box30' => :'Boolean', + :'certify_box31' => :'Boolean', + :'certify_box32' => :'Boolean', + :'certify_box33' => :'Boolean', + :'certify_box34' => :'Boolean', + :'certify_box35' => :'Boolean', + :'certify_box36' => :'Boolean', + :'certify_box37_a' => :'Boolean', + :'certify_box37_b' => :'Boolean', + :'certify_box38' => :'Boolean', + :'certify_box39' => :'Boolean', + :'certify_box40_a' => :'Boolean', + :'certify_box40_b' => :'Boolean', + :'certify_box40_c' => :'Boolean', + :'certify_box41' => :'Boolean', + :'certify_box43' => :'Boolean', + :'certify_part29_signature' => :'Boolean', + :'part19_formation_or_resolution_date' => :'Time', + :'part20_filing_date' => :'Time', + :'part21_determination_date' => :'Time', + :'substantial_us_owners' => :'Array', + :'ein' => :'String', + :'ein_type' => :'String', + :'certify_box14' => :'Boolean', + :'certify_box15_a' => :'Boolean', + :'certify_box15_b' => :'Boolean', + :'certify_box15_c' => :'Boolean', + :'certify_box15_d' => :'Boolean', + :'certify_box15_e' => :'Boolean', + :'certify_box15_f' => :'Boolean', + :'certify_box15_g' => :'Boolean', + :'certify_box15_h' => :'Boolean', + :'certify_box15_i' => :'Boolean', + :'certify_box16_a' => :'Boolean', + :'box16_b_qdd_corporate' => :'Boolean', + :'box16_b_qdd_partnership' => :'Boolean', + :'box16_b_qdd_disregarded_entity' => :'Boolean', + :'certify_box17_a' => :'Boolean', + :'certify_box17_b' => :'Boolean', + :'certify_box17_c' => :'Boolean', + :'certify_box17_d' => :'Boolean', + :'certify_box17_e' => :'Boolean', + :'certify_box18_a' => :'Boolean', + :'certify_box18_b' => :'Boolean', + :'certify_box18_c' => :'Boolean', + :'certify_box18_d' => :'Boolean', + :'certify_box18_e' => :'Boolean', + :'certify_box18_f' => :'Boolean', + :'certify_box19_a' => :'Boolean', + :'certify_box19_b' => :'Boolean', + :'certify_box19_c' => :'Boolean', + :'certify_box19_d' => :'Boolean', + :'certify_box19_e' => :'Boolean', + :'certify_box19_f' => :'Boolean', + :'certify_box20' => :'Boolean', + :'certify_box21_a' => :'Boolean', + :'certify_box21_b' => :'Boolean', + :'certify_box21_c' => :'Boolean', + :'certify_box21_d' => :'Boolean', + :'certify_box21_e' => :'Boolean', + :'certify_box21_f' => :'Boolean', + :'box23_a_name_sponsoring_entity' => :'String', + :'certify_box23_b' => :'Boolean', + :'certify_box23_c' => :'Boolean', + :'certify_box25' => :'Boolean', + :'box27_a_name_sponsoring_entity' => :'String', + :'certify_box27_b' => :'Boolean', + :'certify_box28' => :'Boolean', + :'certify_box29' => :'Boolean', + :'certify_box30_a' => :'Boolean', + :'certify_box30_b' => :'Boolean', + :'certify_box30_c' => :'Boolean', + :'box32_iga_country' => :'String', + :'box32_iga_type' => :'String', + :'box32_iga_treated_as' => :'String', + :'box32_trustee_or_sponsor' => :'String', + :'box32_trustee_is_foreign' => :'Boolean', + :'certify_box33_a' => :'Boolean', + :'certify_box33_b' => :'Boolean', + :'certify_box33_c' => :'Boolean', + :'certify_box33_d' => :'Boolean', + :'certify_box33_e' => :'Boolean', + :'certify_box33_f' => :'Boolean', + :'box37_a_securities_market' => :'String', + :'box37_b_name_of_entity' => :'String', + :'box37_b_securities_market' => :'String', + :'certify_box40' => :'Boolean', + :'box41_sponsoring_entity' => :'String', + :'certify_box42' => :'Boolean', + :'box35_formed_on_date' => :'Time', + :'box36_filed_on_date' => :'Time', + :'tin_match_status' => :'String', + :'signature' => :'String', + :'business_classification' => :'String', + :'business_name' => :'String', + :'business_other' => :'String', + :'exempt_payee_code' => :'String', + :'exempt_fatca_code' => :'String', + :'account_number' => :'String', + :'foreign_country_indicator' => :'Boolean', + :'foreign_address' => :'String', + :'backup_withholding' => :'Boolean', + :'is1099able' => :'Boolean', + :'foreign_partner_owner_or_beneficiary' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'signed_date', + :'birthday', + :'foreign_tin_not_required', + :'archived', + :'reference_id', + :'company_id', + :'display_name', + :'email', + :'type_of_tin', + :'name', + :'residence_address', + :'residence_city', + :'residence_state', + :'residence_postal_code', + :'residence_country', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_postal_code', + :'mailing_country', + :'tin', + :'foreign_tin', + :'reference_number', + :'citizenship_country', + :'treaty_country', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'signer_name', + :'signer_capacity', + :'e_delivery_consented_at', + :'created_at', + :'updated_at', + :'employee_first_name', + :'employee_middle_name', + :'employee_last_name', + :'employee_name_suffix', + :'address', + :'city', + :'state', + :'zip', + :'box3_marital_status', + :'box4_last_name_differs', + :'box5_num_allowances', + :'other_dependents', + :'non_job_income', + :'deductions', + :'box6_additional_withheld', + :'box7_exempt_from_withholding', + :'office_code', + :'disregarded_entity_chapter4_fatca_status', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_postal_code', + :'disregarded_country', + :'ftin_not_required', + :'giin', + :'chapter3_entity_type', + :'chapter4_fatca_status', + :'disregarded_entity', + :'disregarded_entity_giin', + :'benefit_limitation', + :'part4_sponsoring_entity', + :'part4_sponsoring_entity_giin', + :'part7_sponsoring_entity', + :'part12_iga_country', + :'part12_iga_type', + :'part12_fatca_status_under_iga_annex_ii', + :'part12_trustee_name', + :'part12_trustee_is_foreign', + :'part12_model2_iga_giin', + :'box37_a_exchange', + :'box37_b_exchange', + :'box37_b_entity', + :'part28_sponsoring_entity', + :'part28_sponsoring_entity_giin', + :'making_treaty_claim', + :'part19_formation_or_resolution_date', + :'part20_filing_date', + :'part21_determination_date', + :'ein', + :'ein_type', + :'box23_a_name_sponsoring_entity', + :'box27_a_name_sponsoring_entity', + :'box32_iga_country', + :'box32_iga_type', + :'box32_iga_treated_as', + :'box32_trustee_or_sponsor', + :'box37_a_securities_market', + :'box37_b_name_of_entity', + :'box37_b_securities_market', + :'box41_sponsoring_entity', + :'box35_formed_on_date', + :'box36_filed_on_date', + :'tin_match_status', + :'signature', + :'business_classification', + :'business_name', + :'business_other', + :'exempt_payee_code', + :'exempt_fatca_code', + :'account_number', + :'foreign_country_indicator', + :'foreign_address', + :'backup_withholding', + :'is1099able', + :'foreign_partner_owner_or_beneficiary' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'IW9FormDataModelsOneOf' + ] + 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::W8BenFormDataModel` 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::W8BenFormDataModel`. 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?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'birthday') + self.birthday = attributes[:'birthday'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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_postal_code') + self.residence_postal_code = attributes[:'residence_postal_code'] + 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_postal_code') + self.mailing_postal_code = attributes[:'mailing_postal_code'] + 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') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + 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?(:'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?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'signer_capacity') + self.signer_capacity = attributes[:'signer_capacity'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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?(:'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?(:'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?(:'box3_marital_status') + self.box3_marital_status = attributes[:'box3_marital_status'] + end + + if attributes.key?(:'box4_last_name_differs') + self.box4_last_name_differs = attributes[:'box4_last_name_differs'] + end + + if attributes.key?(:'box5_num_allowances') + self.box5_num_allowances = attributes[:'box5_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?(:'box6_additional_withheld') + self.box6_additional_withheld = attributes[:'box6_additional_withheld'] + end + + if attributes.key?(:'box7_exempt_from_withholding') + self.box7_exempt_from_withholding = attributes[:'box7_exempt_from_withholding'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'disregarded_entity_chapter4_fatca_status') + self.disregarded_entity_chapter4_fatca_status = attributes[:'disregarded_entity_chapter4_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_postal_code') + self.disregarded_postal_code = attributes[:'disregarded_postal_code'] + end + + if attributes.key?(:'disregarded_country') + self.disregarded_country = attributes[:'disregarded_country'] + end + + if attributes.key?(:'ftin_not_required') + self.ftin_not_required = attributes[:'ftin_not_required'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'chapter3_entity_type') + self.chapter3_entity_type = attributes[:'chapter3_entity_type'] + end + + if attributes.key?(:'chapter4_fatca_status') + self.chapter4_fatca_status = attributes[:'chapter4_fatca_status'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + end + + if attributes.key?(:'disregarded_entity_giin') + self.disregarded_entity_giin = attributes[:'disregarded_entity_giin'] + end + + if attributes.key?(:'benefit_limitation') + self.benefit_limitation = attributes[:'benefit_limitation'] + end + + if attributes.key?(:'part4_sponsoring_entity') + self.part4_sponsoring_entity = attributes[:'part4_sponsoring_entity'] + end + + if attributes.key?(:'part4_sponsoring_entity_giin') + self.part4_sponsoring_entity_giin = attributes[:'part4_sponsoring_entity_giin'] + end + + if attributes.key?(:'part7_sponsoring_entity') + self.part7_sponsoring_entity = attributes[:'part7_sponsoring_entity'] + end + + if attributes.key?(:'part12_iga_country') + self.part12_iga_country = attributes[:'part12_iga_country'] + end + + if attributes.key?(:'part12_iga_type') + self.part12_iga_type = attributes[:'part12_iga_type'] + end + + if attributes.key?(:'part12_fatca_status_under_iga_annex_ii') + self.part12_fatca_status_under_iga_annex_ii = attributes[:'part12_fatca_status_under_iga_annex_ii'] + end + + if attributes.key?(:'part12_trustee_name') + self.part12_trustee_name = attributes[:'part12_trustee_name'] + end + + if attributes.key?(:'part12_trustee_is_foreign') + self.part12_trustee_is_foreign = attributes[:'part12_trustee_is_foreign'] + end + + if attributes.key?(:'part12_model2_iga_giin') + self.part12_model2_iga_giin = attributes[:'part12_model2_iga_giin'] + end + + if attributes.key?(:'box37_a_exchange') + self.box37_a_exchange = attributes[:'box37_a_exchange'] + end + + if attributes.key?(:'box37_b_exchange') + self.box37_b_exchange = attributes[:'box37_b_exchange'] + end + + if attributes.key?(:'box37_b_entity') + self.box37_b_entity = attributes[:'box37_b_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity') + self.part28_sponsoring_entity = attributes[:'part28_sponsoring_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity_giin') + self.part28_sponsoring_entity_giin = attributes[:'part28_sponsoring_entity_giin'] + end + + if attributes.key?(:'making_treaty_claim') + self.making_treaty_claim = attributes[:'making_treaty_claim'] + end + + if attributes.key?(:'certify_box14_a') + self.certify_box14_a = attributes[:'certify_box14_a'] + end + + if attributes.key?(:'certify_box14_b') + self.certify_box14_b = attributes[:'certify_box14_b'] + end + + if attributes.key?(:'certify_box14_c') + self.certify_box14_c = attributes[:'certify_box14_c'] + end + + if attributes.key?(:'certify_box17_1') + self.certify_box17_1 = attributes[:'certify_box17_1'] + end + + if attributes.key?(:'certify_box17_2') + self.certify_box17_2 = attributes[:'certify_box17_2'] + end + + if attributes.key?(:'certify_box18') + self.certify_box18 = attributes[:'certify_box18'] + end + + if attributes.key?(:'certify_box19') + self.certify_box19 = attributes[:'certify_box19'] + end + + if attributes.key?(:'certify_box21') + self.certify_box21 = attributes[:'certify_box21'] + end + + if attributes.key?(:'certify_box22') + self.certify_box22 = attributes[:'certify_box22'] + end + + if attributes.key?(:'certify_box23') + self.certify_box23 = attributes[:'certify_box23'] + end + + if attributes.key?(:'certify_box24_a') + self.certify_box24_a = attributes[:'certify_box24_a'] + end + + if attributes.key?(:'certify_box24_b') + self.certify_box24_b = attributes[:'certify_box24_b'] + end + + if attributes.key?(:'certify_box24_c') + self.certify_box24_c = attributes[:'certify_box24_c'] + end + + if attributes.key?(:'certify_box24_d') + self.certify_box24_d = attributes[:'certify_box24_d'] + end + + if attributes.key?(:'certify_box25_a') + self.certify_box25_a = attributes[:'certify_box25_a'] + end + + if attributes.key?(:'certify_box25_b') + self.certify_box25_b = attributes[:'certify_box25_b'] + end + + if attributes.key?(:'certify_box25_c') + self.certify_box25_c = attributes[:'certify_box25_c'] + end + + if attributes.key?(:'certify_box26') + self.certify_box26 = attributes[:'certify_box26'] + end + + if attributes.key?(:'certify_box27') + self.certify_box27 = attributes[:'certify_box27'] + end + + if attributes.key?(:'certify_box28_a') + self.certify_box28_a = attributes[:'certify_box28_a'] + end + + if attributes.key?(:'certify_box28_b') + self.certify_box28_b = attributes[:'certify_box28_b'] + end + + if attributes.key?(:'certify_box29_a') + self.certify_box29_a = attributes[:'certify_box29_a'] + end + + if attributes.key?(:'certify_box29_b') + self.certify_box29_b = attributes[:'certify_box29_b'] + end + + if attributes.key?(:'certify_box29_c') + self.certify_box29_c = attributes[:'certify_box29_c'] + end + + if attributes.key?(:'certify_box29_d') + self.certify_box29_d = attributes[:'certify_box29_d'] + end + + if attributes.key?(:'certify_box29_e') + self.certify_box29_e = attributes[:'certify_box29_e'] + end + + if attributes.key?(:'certify_box29_f') + self.certify_box29_f = attributes[:'certify_box29_f'] + end + + if attributes.key?(:'certify_box30') + self.certify_box30 = attributes[:'certify_box30'] + end + + if attributes.key?(:'certify_box31') + self.certify_box31 = attributes[:'certify_box31'] + end + + if attributes.key?(:'certify_box32') + self.certify_box32 = attributes[:'certify_box32'] + end + + if attributes.key?(:'certify_box33') + self.certify_box33 = attributes[:'certify_box33'] + end + + if attributes.key?(:'certify_box34') + self.certify_box34 = attributes[:'certify_box34'] + end + + if attributes.key?(:'certify_box35') + self.certify_box35 = attributes[:'certify_box35'] + end + + if attributes.key?(:'certify_box36') + self.certify_box36 = attributes[:'certify_box36'] + end + + if attributes.key?(:'certify_box37_a') + self.certify_box37_a = attributes[:'certify_box37_a'] + end + + if attributes.key?(:'certify_box37_b') + self.certify_box37_b = attributes[:'certify_box37_b'] + end + + if attributes.key?(:'certify_box38') + self.certify_box38 = attributes[:'certify_box38'] + end + + if attributes.key?(:'certify_box39') + self.certify_box39 = attributes[:'certify_box39'] + end + + if attributes.key?(:'certify_box40_a') + self.certify_box40_a = attributes[:'certify_box40_a'] + end + + if attributes.key?(:'certify_box40_b') + self.certify_box40_b = attributes[:'certify_box40_b'] + end + + if attributes.key?(:'certify_box40_c') + self.certify_box40_c = attributes[:'certify_box40_c'] + end + + if attributes.key?(:'certify_box41') + self.certify_box41 = attributes[:'certify_box41'] + end + + if attributes.key?(:'certify_box43') + self.certify_box43 = attributes[:'certify_box43'] + end + + if attributes.key?(:'certify_part29_signature') + self.certify_part29_signature = attributes[:'certify_part29_signature'] + end + + if attributes.key?(:'part19_formation_or_resolution_date') + self.part19_formation_or_resolution_date = attributes[:'part19_formation_or_resolution_date'] + end + + if attributes.key?(:'part20_filing_date') + self.part20_filing_date = attributes[:'part20_filing_date'] + end + + if attributes.key?(:'part21_determination_date') + self.part21_determination_date = attributes[:'part21_determination_date'] + 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?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'ein_type') + self.ein_type = attributes[:'ein_type'] + end + + if attributes.key?(:'certify_box14') + self.certify_box14 = attributes[:'certify_box14'] + end + + if attributes.key?(:'certify_box15_a') + self.certify_box15_a = attributes[:'certify_box15_a'] + end + + if attributes.key?(:'certify_box15_b') + self.certify_box15_b = attributes[:'certify_box15_b'] + end + + if attributes.key?(:'certify_box15_c') + self.certify_box15_c = attributes[:'certify_box15_c'] + end + + if attributes.key?(:'certify_box15_d') + self.certify_box15_d = attributes[:'certify_box15_d'] + end + + if attributes.key?(:'certify_box15_e') + self.certify_box15_e = attributes[:'certify_box15_e'] + end + + if attributes.key?(:'certify_box15_f') + self.certify_box15_f = attributes[:'certify_box15_f'] + end + + if attributes.key?(:'certify_box15_g') + self.certify_box15_g = attributes[:'certify_box15_g'] + end + + if attributes.key?(:'certify_box15_h') + self.certify_box15_h = attributes[:'certify_box15_h'] + end + + if attributes.key?(:'certify_box15_i') + self.certify_box15_i = attributes[:'certify_box15_i'] + end + + if attributes.key?(:'certify_box16_a') + self.certify_box16_a = attributes[:'certify_box16_a'] + end + + if attributes.key?(:'box16_b_qdd_corporate') + self.box16_b_qdd_corporate = attributes[:'box16_b_qdd_corporate'] + end + + if attributes.key?(:'box16_b_qdd_partnership') + self.box16_b_qdd_partnership = attributes[:'box16_b_qdd_partnership'] + end + + if attributes.key?(:'box16_b_qdd_disregarded_entity') + self.box16_b_qdd_disregarded_entity = attributes[:'box16_b_qdd_disregarded_entity'] + end + + if attributes.key?(:'certify_box17_a') + self.certify_box17_a = attributes[:'certify_box17_a'] + end + + if attributes.key?(:'certify_box17_b') + self.certify_box17_b = attributes[:'certify_box17_b'] + end + + if attributes.key?(:'certify_box17_c') + self.certify_box17_c = attributes[:'certify_box17_c'] + end + + if attributes.key?(:'certify_box17_d') + self.certify_box17_d = attributes[:'certify_box17_d'] + end + + if attributes.key?(:'certify_box17_e') + self.certify_box17_e = attributes[:'certify_box17_e'] + end + + if attributes.key?(:'certify_box18_a') + self.certify_box18_a = attributes[:'certify_box18_a'] + end + + if attributes.key?(:'certify_box18_b') + self.certify_box18_b = attributes[:'certify_box18_b'] + end + + if attributes.key?(:'certify_box18_c') + self.certify_box18_c = attributes[:'certify_box18_c'] + end + + if attributes.key?(:'certify_box18_d') + self.certify_box18_d = attributes[:'certify_box18_d'] + end + + if attributes.key?(:'certify_box18_e') + self.certify_box18_e = attributes[:'certify_box18_e'] + end + + if attributes.key?(:'certify_box18_f') + self.certify_box18_f = attributes[:'certify_box18_f'] + end + + if attributes.key?(:'certify_box19_a') + self.certify_box19_a = attributes[:'certify_box19_a'] + end + + if attributes.key?(:'certify_box19_b') + self.certify_box19_b = attributes[:'certify_box19_b'] + end + + if attributes.key?(:'certify_box19_c') + self.certify_box19_c = attributes[:'certify_box19_c'] + end + + if attributes.key?(:'certify_box19_d') + self.certify_box19_d = attributes[:'certify_box19_d'] + end + + if attributes.key?(:'certify_box19_e') + self.certify_box19_e = attributes[:'certify_box19_e'] + end + + if attributes.key?(:'certify_box19_f') + self.certify_box19_f = attributes[:'certify_box19_f'] + end + + if attributes.key?(:'certify_box20') + self.certify_box20 = attributes[:'certify_box20'] + end + + if attributes.key?(:'certify_box21_a') + self.certify_box21_a = attributes[:'certify_box21_a'] + end + + if attributes.key?(:'certify_box21_b') + self.certify_box21_b = attributes[:'certify_box21_b'] + end + + if attributes.key?(:'certify_box21_c') + self.certify_box21_c = attributes[:'certify_box21_c'] + end + + if attributes.key?(:'certify_box21_d') + self.certify_box21_d = attributes[:'certify_box21_d'] + end + + if attributes.key?(:'certify_box21_e') + self.certify_box21_e = attributes[:'certify_box21_e'] + end + + if attributes.key?(:'certify_box21_f') + self.certify_box21_f = attributes[:'certify_box21_f'] + end + + if attributes.key?(:'box23_a_name_sponsoring_entity') + self.box23_a_name_sponsoring_entity = attributes[:'box23_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box23_b') + self.certify_box23_b = attributes[:'certify_box23_b'] + end + + if attributes.key?(:'certify_box23_c') + self.certify_box23_c = attributes[:'certify_box23_c'] + end + + if attributes.key?(:'certify_box25') + self.certify_box25 = attributes[:'certify_box25'] + end + + if attributes.key?(:'box27_a_name_sponsoring_entity') + self.box27_a_name_sponsoring_entity = attributes[:'box27_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box27_b') + self.certify_box27_b = attributes[:'certify_box27_b'] + end + + if attributes.key?(:'certify_box28') + self.certify_box28 = attributes[:'certify_box28'] + end + + if attributes.key?(:'certify_box29') + self.certify_box29 = attributes[:'certify_box29'] + end + + if attributes.key?(:'certify_box30_a') + self.certify_box30_a = attributes[:'certify_box30_a'] + end + + if attributes.key?(:'certify_box30_b') + self.certify_box30_b = attributes[:'certify_box30_b'] + end + + if attributes.key?(:'certify_box30_c') + self.certify_box30_c = attributes[:'certify_box30_c'] + end + + if attributes.key?(:'box32_iga_country') + self.box32_iga_country = attributes[:'box32_iga_country'] + end + + if attributes.key?(:'box32_iga_type') + self.box32_iga_type = attributes[:'box32_iga_type'] + end + + if attributes.key?(:'box32_iga_treated_as') + self.box32_iga_treated_as = attributes[:'box32_iga_treated_as'] + end + + if attributes.key?(:'box32_trustee_or_sponsor') + self.box32_trustee_or_sponsor = attributes[:'box32_trustee_or_sponsor'] + end + + if attributes.key?(:'box32_trustee_is_foreign') + self.box32_trustee_is_foreign = attributes[:'box32_trustee_is_foreign'] + end + + if attributes.key?(:'certify_box33_a') + self.certify_box33_a = attributes[:'certify_box33_a'] + end + + if attributes.key?(:'certify_box33_b') + self.certify_box33_b = attributes[:'certify_box33_b'] + end + + if attributes.key?(:'certify_box33_c') + self.certify_box33_c = attributes[:'certify_box33_c'] + end + + if attributes.key?(:'certify_box33_d') + self.certify_box33_d = attributes[:'certify_box33_d'] + end + + if attributes.key?(:'certify_box33_e') + self.certify_box33_e = attributes[:'certify_box33_e'] + end + + if attributes.key?(:'certify_box33_f') + self.certify_box33_f = attributes[:'certify_box33_f'] + end + + if attributes.key?(:'box37_a_securities_market') + self.box37_a_securities_market = attributes[:'box37_a_securities_market'] + end + + if attributes.key?(:'box37_b_name_of_entity') + self.box37_b_name_of_entity = attributes[:'box37_b_name_of_entity'] + end + + if attributes.key?(:'box37_b_securities_market') + self.box37_b_securities_market = attributes[:'box37_b_securities_market'] + end + + if attributes.key?(:'certify_box40') + self.certify_box40 = attributes[:'certify_box40'] + end + + if attributes.key?(:'box41_sponsoring_entity') + self.box41_sponsoring_entity = attributes[:'box41_sponsoring_entity'] + end + + if attributes.key?(:'certify_box42') + self.certify_box42 = attributes[:'certify_box42'] + end + + if attributes.key?(:'box35_formed_on_date') + self.box35_formed_on_date = attributes[:'box35_formed_on_date'] + end + + if attributes.key?(:'box36_filed_on_date') + self.box36_filed_on_date = attributes[:'box36_filed_on_date'] + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'business_classification') + self.business_classification = attributes[:'business_classification'] + end + + if attributes.key?(:'business_name') + self.business_name = attributes[:'business_name'] + end + + if attributes.key?(:'business_other') + self.business_other = attributes[:'business_other'] + 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?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'foreign_country_indicator') + self.foreign_country_indicator = attributes[:'foreign_country_indicator'] + end + + if attributes.key?(:'foreign_address') + self.foreign_address = attributes[:'foreign_address'] + 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?(:'foreign_partner_owner_or_beneficiary') + self.foreign_partner_owner_or_beneficiary = attributes[:'foreign_partner_owner_or_beneficiary'] + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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] substantial_us_owners Value to be assigned + def substantial_us_owners=(substantial_us_owners) + if substantial_us_owners.nil? + fail ArgumentError, 'substantial_us_owners cannot be nil' + end + + @substantial_us_owners = substantial_us_owners + 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 && + signed_date == o.signed_date && + birthday == o.birthday && + foreign_tin_not_required == o.foreign_tin_not_required && + archived == o.archived && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + type_of_tin == o.type_of_tin && + name == o.name && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_postal_code == o.residence_postal_code && + 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_postal_code == o.mailing_postal_code && + mailing_country == o.mailing_country && + tin == o.tin && + foreign_tin == o.foreign_tin && + reference_number == o.reference_number && + citizenship_country == o.citizenship_country && + treaty_country == o.treaty_country && + treaty_article == o.treaty_article && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + treaty_reasons == o.treaty_reasons && + signer_name == o.signer_name && + signer_capacity == o.signer_capacity && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at && + 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 && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + box3_marital_status == o.box3_marital_status && + box4_last_name_differs == o.box4_last_name_differs && + box5_num_allowances == o.box5_num_allowances && + other_dependents == o.other_dependents && + non_job_income == o.non_job_income && + deductions == o.deductions && + box6_additional_withheld == o.box6_additional_withheld && + box7_exempt_from_withholding == o.box7_exempt_from_withholding && + office_code == o.office_code && + disregarded_entity_chapter4_fatca_status == o.disregarded_entity_chapter4_fatca_status && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_postal_code == o.disregarded_postal_code && + disregarded_country == o.disregarded_country && + ftin_not_required == o.ftin_not_required && + giin == o.giin && + chapter3_entity_type == o.chapter3_entity_type && + chapter4_fatca_status == o.chapter4_fatca_status && + disregarded_entity == o.disregarded_entity && + disregarded_entity_giin == o.disregarded_entity_giin && + benefit_limitation == o.benefit_limitation && + part4_sponsoring_entity == o.part4_sponsoring_entity && + part4_sponsoring_entity_giin == o.part4_sponsoring_entity_giin && + part7_sponsoring_entity == o.part7_sponsoring_entity && + part12_iga_country == o.part12_iga_country && + part12_iga_type == o.part12_iga_type && + part12_fatca_status_under_iga_annex_ii == o.part12_fatca_status_under_iga_annex_ii && + part12_trustee_name == o.part12_trustee_name && + part12_trustee_is_foreign == o.part12_trustee_is_foreign && + part12_model2_iga_giin == o.part12_model2_iga_giin && + box37_a_exchange == o.box37_a_exchange && + box37_b_exchange == o.box37_b_exchange && + box37_b_entity == o.box37_b_entity && + part28_sponsoring_entity == o.part28_sponsoring_entity && + part28_sponsoring_entity_giin == o.part28_sponsoring_entity_giin && + making_treaty_claim == o.making_treaty_claim && + certify_box14_a == o.certify_box14_a && + certify_box14_b == o.certify_box14_b && + certify_box14_c == o.certify_box14_c && + certify_box17_1 == o.certify_box17_1 && + certify_box17_2 == o.certify_box17_2 && + certify_box18 == o.certify_box18 && + certify_box19 == o.certify_box19 && + certify_box21 == o.certify_box21 && + certify_box22 == o.certify_box22 && + certify_box23 == o.certify_box23 && + certify_box24_a == o.certify_box24_a && + certify_box24_b == o.certify_box24_b && + certify_box24_c == o.certify_box24_c && + certify_box24_d == o.certify_box24_d && + certify_box25_a == o.certify_box25_a && + certify_box25_b == o.certify_box25_b && + certify_box25_c == o.certify_box25_c && + certify_box26 == o.certify_box26 && + certify_box27 == o.certify_box27 && + certify_box28_a == o.certify_box28_a && + certify_box28_b == o.certify_box28_b && + certify_box29_a == o.certify_box29_a && + certify_box29_b == o.certify_box29_b && + certify_box29_c == o.certify_box29_c && + certify_box29_d == o.certify_box29_d && + certify_box29_e == o.certify_box29_e && + certify_box29_f == o.certify_box29_f && + certify_box30 == o.certify_box30 && + certify_box31 == o.certify_box31 && + certify_box32 == o.certify_box32 && + certify_box33 == o.certify_box33 && + certify_box34 == o.certify_box34 && + certify_box35 == o.certify_box35 && + certify_box36 == o.certify_box36 && + certify_box37_a == o.certify_box37_a && + certify_box37_b == o.certify_box37_b && + certify_box38 == o.certify_box38 && + certify_box39 == o.certify_box39 && + certify_box40_a == o.certify_box40_a && + certify_box40_b == o.certify_box40_b && + certify_box40_c == o.certify_box40_c && + certify_box41 == o.certify_box41 && + certify_box43 == o.certify_box43 && + certify_part29_signature == o.certify_part29_signature && + part19_formation_or_resolution_date == o.part19_formation_or_resolution_date && + part20_filing_date == o.part20_filing_date && + part21_determination_date == o.part21_determination_date && + substantial_us_owners == o.substantial_us_owners && + ein == o.ein && + ein_type == o.ein_type && + certify_box14 == o.certify_box14 && + certify_box15_a == o.certify_box15_a && + certify_box15_b == o.certify_box15_b && + certify_box15_c == o.certify_box15_c && + certify_box15_d == o.certify_box15_d && + certify_box15_e == o.certify_box15_e && + certify_box15_f == o.certify_box15_f && + certify_box15_g == o.certify_box15_g && + certify_box15_h == o.certify_box15_h && + certify_box15_i == o.certify_box15_i && + certify_box16_a == o.certify_box16_a && + box16_b_qdd_corporate == o.box16_b_qdd_corporate && + box16_b_qdd_partnership == o.box16_b_qdd_partnership && + box16_b_qdd_disregarded_entity == o.box16_b_qdd_disregarded_entity && + certify_box17_a == o.certify_box17_a && + certify_box17_b == o.certify_box17_b && + certify_box17_c == o.certify_box17_c && + certify_box17_d == o.certify_box17_d && + certify_box17_e == o.certify_box17_e && + certify_box18_a == o.certify_box18_a && + certify_box18_b == o.certify_box18_b && + certify_box18_c == o.certify_box18_c && + certify_box18_d == o.certify_box18_d && + certify_box18_e == o.certify_box18_e && + certify_box18_f == o.certify_box18_f && + certify_box19_a == o.certify_box19_a && + certify_box19_b == o.certify_box19_b && + certify_box19_c == o.certify_box19_c && + certify_box19_d == o.certify_box19_d && + certify_box19_e == o.certify_box19_e && + certify_box19_f == o.certify_box19_f && + certify_box20 == o.certify_box20 && + certify_box21_a == o.certify_box21_a && + certify_box21_b == o.certify_box21_b && + certify_box21_c == o.certify_box21_c && + certify_box21_d == o.certify_box21_d && + certify_box21_e == o.certify_box21_e && + certify_box21_f == o.certify_box21_f && + box23_a_name_sponsoring_entity == o.box23_a_name_sponsoring_entity && + certify_box23_b == o.certify_box23_b && + certify_box23_c == o.certify_box23_c && + certify_box25 == o.certify_box25 && + box27_a_name_sponsoring_entity == o.box27_a_name_sponsoring_entity && + certify_box27_b == o.certify_box27_b && + certify_box28 == o.certify_box28 && + certify_box29 == o.certify_box29 && + certify_box30_a == o.certify_box30_a && + certify_box30_b == o.certify_box30_b && + certify_box30_c == o.certify_box30_c && + box32_iga_country == o.box32_iga_country && + box32_iga_type == o.box32_iga_type && + box32_iga_treated_as == o.box32_iga_treated_as && + box32_trustee_or_sponsor == o.box32_trustee_or_sponsor && + box32_trustee_is_foreign == o.box32_trustee_is_foreign && + certify_box33_a == o.certify_box33_a && + certify_box33_b == o.certify_box33_b && + certify_box33_c == o.certify_box33_c && + certify_box33_d == o.certify_box33_d && + certify_box33_e == o.certify_box33_e && + certify_box33_f == o.certify_box33_f && + box37_a_securities_market == o.box37_a_securities_market && + box37_b_name_of_entity == o.box37_b_name_of_entity && + box37_b_securities_market == o.box37_b_securities_market && + certify_box40 == o.certify_box40 && + box41_sponsoring_entity == o.box41_sponsoring_entity && + certify_box42 == o.certify_box42 && + box35_formed_on_date == o.box35_formed_on_date && + box36_filed_on_date == o.box36_filed_on_date && + tin_match_status == o.tin_match_status && + signature == o.signature && + business_classification == o.business_classification && + business_name == o.business_name && + business_other == o.business_other && + exempt_payee_code == o.exempt_payee_code && + exempt_fatca_code == o.exempt_fatca_code && + account_number == o.account_number && + foreign_country_indicator == o.foreign_country_indicator && + foreign_address == o.foreign_address && + backup_withholding == o.backup_withholding && + is1099able == o.is1099able && + foreign_partner_owner_or_beneficiary == o.foreign_partner_owner_or_beneficiary + 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, signed_date, birthday, foreign_tin_not_required, archived, reference_id, company_id, display_name, email, type_of_tin, name, residence_address, residence_city, residence_state, residence_postal_code, residence_country, residence_is_mailing, mailing_address, mailing_city, mailing_state, mailing_postal_code, mailing_country, tin, foreign_tin, reference_number, citizenship_country, treaty_country, treaty_article, withholding_rate, income_type, treaty_reasons, signer_name, signer_capacity, e_delivery_consented_at, created_at, updated_at, employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, address, city, state, zip, box3_marital_status, box4_last_name_differs, box5_num_allowances, other_dependents, non_job_income, deductions, box6_additional_withheld, box7_exempt_from_withholding, office_code, disregarded_entity_chapter4_fatca_status, disregarded_address, disregarded_city, disregarded_state, disregarded_postal_code, disregarded_country, ftin_not_required, giin, chapter3_entity_type, chapter4_fatca_status, disregarded_entity, disregarded_entity_giin, benefit_limitation, part4_sponsoring_entity, part4_sponsoring_entity_giin, part7_sponsoring_entity, part12_iga_country, part12_iga_type, part12_fatca_status_under_iga_annex_ii, part12_trustee_name, part12_trustee_is_foreign, part12_model2_iga_giin, box37_a_exchange, box37_b_exchange, box37_b_entity, part28_sponsoring_entity, part28_sponsoring_entity_giin, making_treaty_claim, certify_box14_a, certify_box14_b, certify_box14_c, certify_box17_1, certify_box17_2, certify_box18, certify_box19, certify_box21, certify_box22, certify_box23, certify_box24_a, certify_box24_b, certify_box24_c, certify_box24_d, certify_box25_a, certify_box25_b, certify_box25_c, certify_box26, certify_box27, certify_box28_a, certify_box28_b, certify_box29_a, certify_box29_b, certify_box29_c, certify_box29_d, certify_box29_e, certify_box29_f, certify_box30, certify_box31, certify_box32, certify_box33, certify_box34, certify_box35, certify_box36, certify_box37_a, certify_box37_b, certify_box38, certify_box39, certify_box40_a, certify_box40_b, certify_box40_c, certify_box41, certify_box43, certify_part29_signature, part19_formation_or_resolution_date, part20_filing_date, part21_determination_date, substantial_us_owners, ein, ein_type, certify_box14, certify_box15_a, certify_box15_b, certify_box15_c, certify_box15_d, certify_box15_e, certify_box15_f, certify_box15_g, certify_box15_h, certify_box15_i, certify_box16_a, box16_b_qdd_corporate, box16_b_qdd_partnership, box16_b_qdd_disregarded_entity, certify_box17_a, certify_box17_b, certify_box17_c, certify_box17_d, certify_box17_e, certify_box18_a, certify_box18_b, certify_box18_c, certify_box18_d, certify_box18_e, certify_box18_f, certify_box19_a, certify_box19_b, certify_box19_c, certify_box19_d, certify_box19_e, certify_box19_f, certify_box20, certify_box21_a, certify_box21_b, certify_box21_c, certify_box21_d, certify_box21_e, certify_box21_f, box23_a_name_sponsoring_entity, certify_box23_b, certify_box23_c, certify_box25, box27_a_name_sponsoring_entity, certify_box27_b, certify_box28, certify_box29, certify_box30_a, certify_box30_b, certify_box30_c, box32_iga_country, box32_iga_type, box32_iga_treated_as, box32_trustee_or_sponsor, box32_trustee_is_foreign, certify_box33_a, certify_box33_b, certify_box33_c, certify_box33_d, certify_box33_e, certify_box33_f, box37_a_securities_market, box37_b_name_of_entity, box37_b_securities_market, certify_box40, box41_sponsoring_entity, certify_box42, box35_formed_on_date, box36_filed_on_date, tin_match_status, signature, business_classification, business_name, business_other, exempt_payee_code, exempt_fatca_code, account_number, foreign_country_indicator, foreign_address, backup_withholding, is1099able, foreign_partner_owner_or_beneficiary].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 new file mode 100644 index 0000000..8018fa9 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb @@ -0,0 +1,631 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8BenFormResponse + # 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 type of TIN provided. + attr_accessor :tin_type + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # 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 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 capacity in which the signer is signing the form. + attr_accessor :signer_capacity + + # The unique identifier for the form. + attr_accessor :id + + # The form type. + attr_accessor :type + + # The form status. + attr_accessor :entry_status + + # The timestamp for the latest status update. + attr_accessor :entry_status_date + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # Indicates whether the form is archived. + attr_accessor :archived + + # The signature of the form. + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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_type' => :'tinType', + :'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', + :'signer_capacity' => :'signerCapacity', + :'id' => :'id', + :'type' => :'type', + :'entry_status' => :'entryStatus', + :'entry_status_date' => :'entryStatusDate', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'archived' => :'archived', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'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_type' => :'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', + :'signer_capacity' => :'String', + :'id' => :'String', + :'type' => :'String', + :'entry_status' => :'String', + :'entry_status_date' => :'Time', + :'reference_id' => :'String', + :'company_id' => :'String', + :'display_name' => :'String', + :'email' => :'String', + :'archived' => :'Boolean', + :'signature' => :'String', + :'signed_date' => :'Time', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + 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_type', + :'tin', + :'foreign_tin', + :'reference_number', + :'birthday', + :'treaty_article', + :'treaty_reasons', + :'withholding_rate', + :'income_type', + :'signer_name', + :'signer_capacity', + :'entry_status_date', + :'reference_id', + :'email', + :'signature', + :'signed_date', + :'e_delivery_consented_at', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseResponse' + ] + 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::W8BenFormResponse` 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::W8BenFormResponse`. 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?(:'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_type') + self.tin_type = attributes[:'tin_type'] + 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?(:'signer_capacity') + self.signer_capacity = attributes[:'signer_capacity'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'entry_status') + self.entry_status = attributes[:'entry_status'] + end + + if attributes.key?(:'entry_status_date') + self.entry_status_date = attributes[:'entry_status_date'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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 + 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 && + 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_type == o.tin_type && + 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 && + signer_capacity == o.signer_capacity && + id == o.id && + type == o.type && + entry_status == o.entry_status && + entry_status_date == o.entry_status_date && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + archived == o.archived && + signature == o.signature && + signed_date == o.signed_date && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at + 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, 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_type, tin, foreign_tin_not_required, foreign_tin, reference_number, birthday, treaty_country, treaty_article, treaty_reasons, withholding_rate, income_type, signer_name, signer_capacity, id, type, entry_status, entry_status_date, reference_id, company_id, display_name, email, archived, signature, signed_date, e_delivery_consented_at, created_at, updated_at].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_bene_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb new file mode 100644 index 0000000..ace6872 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb @@ -0,0 +1,2423 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # W-8 BEN-E form + class W8BeneFormDataModel + # Type of the form, always W8BENE for this model. + attr_accessor :type + + # The date the form was signed. + attr_accessor :signed_date + + # The FATCA status for disregarded entities under Chapter 4. + attr_accessor :disregarded_entity_chapter4_fatca_status + + # The creation date of the form. + attr_accessor :created_at + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # 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 postal code of the residence. + attr_accessor :residence_postal_code + + # The country of residence. + attr_accessor :residence_country + + # 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 postal code of the mailing address. + attr_accessor :mailing_postal_code + + # The country of the mailing address. + attr_accessor :mailing_country + + # 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 postal code for disregarded entities. + attr_accessor :disregarded_postal_code + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # The type of TIN provided. + attr_accessor :type_of_tin + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # Indicates whether a foreign TIN is not required. + attr_accessor :ftin_not_required + + # A reference number for the form. + attr_accessor :reference_number + + # The global intermediary identification number (GIIN). + attr_accessor :giin + + # The Chapter 3 entity type. + attr_accessor :chapter3_entity_type + + # The Chapter 4 FATCA status. + attr_accessor :chapter4_fatca_status + + # The disregarded entity information. + attr_accessor :disregarded_entity + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # The benefit limitation for tax treaty claims. + attr_accessor :benefit_limitation + + # The sponsoring entity information for Part 4. + attr_accessor :part4_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 4. + attr_accessor :part4_sponsoring_entity_giin + + # The sponsoring entity information for Part 7. + attr_accessor :part7_sponsoring_entity + + # The IGA country information for Part 12. + attr_accessor :part12_iga_country + + # The IGA type information for Part 12. + attr_accessor :part12_iga_type + + # The FATCA status under IGA Annex II for Part 12. + attr_accessor :part12_fatca_status_under_iga_annex_ii + + # The trustee name for Part 12. + attr_accessor :part12_trustee_name + + # Indicates whether the trustee is foreign for Part 12. + attr_accessor :part12_trustee_is_foreign + + # The GIIN for Model 2 IGA in Part 12. + attr_accessor :part12_model2_iga_giin + + # The exchange information for Box 37A. + attr_accessor :box37_a_exchange + + # The exchange information for Box 37B. + attr_accessor :box37_b_exchange + + # The entity information for Box 37B. + attr_accessor :box37_b_entity + + # The sponsoring entity information for Part 28. + attr_accessor :part28_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 28. + attr_accessor :part28_sponsoring_entity_giin + + # The name of the signer. + attr_accessor :signer_name + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + attr_accessor :residence_is_mailing + + attr_accessor :citizenship_country + + attr_accessor :making_treaty_claim + + attr_accessor :treaty_country + + attr_accessor :treaty_article + + attr_accessor :withholding_rate + + attr_accessor :income_type + + attr_accessor :treaty_reasons + + attr_accessor :certify_box14_a + + attr_accessor :certify_box14_b + + attr_accessor :certify_box14_c + + attr_accessor :certify_box17_1 + + attr_accessor :certify_box17_2 + + attr_accessor :certify_box18 + + attr_accessor :certify_box19 + + attr_accessor :certify_box21 + + attr_accessor :certify_box22 + + attr_accessor :certify_box23 + + attr_accessor :certify_box24_a + + attr_accessor :certify_box24_b + + attr_accessor :certify_box24_c + + attr_accessor :certify_box24_d + + attr_accessor :certify_box25_a + + attr_accessor :certify_box25_b + + attr_accessor :certify_box25_c + + attr_accessor :certify_box26 + + attr_accessor :certify_box27 + + attr_accessor :certify_box28_a + + attr_accessor :certify_box28_b + + attr_accessor :certify_box29_a + + attr_accessor :certify_box29_b + + attr_accessor :certify_box29_c + + attr_accessor :certify_box29_d + + attr_accessor :certify_box29_e + + attr_accessor :certify_box29_f + + attr_accessor :certify_box30 + + attr_accessor :certify_box31 + + attr_accessor :certify_box32 + + attr_accessor :certify_box33 + + attr_accessor :certify_box34 + + attr_accessor :certify_box35 + + attr_accessor :certify_box36 + + attr_accessor :certify_box37_a + + attr_accessor :certify_box37_b + + attr_accessor :certify_box38 + + attr_accessor :certify_box39 + + attr_accessor :certify_box40_a + + attr_accessor :certify_box40_b + + attr_accessor :certify_box40_c + + attr_accessor :certify_box41 + + attr_accessor :certify_box43 + + attr_accessor :certify_part29_signature + + attr_accessor :part19_formation_or_resolution_date + + attr_accessor :part20_filing_date + + attr_accessor :part21_determination_date + + attr_accessor :substantial_us_owners + + # 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 address of the individual or entity. + attr_accessor :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 marital status of the employee. + attr_accessor :box3_marital_status + + # Indicates whether the last name differs from prior records. + attr_accessor :box4_last_name_differs + + # The number of allowances claimed by the employee. + attr_accessor :box5_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 :box6_additional_withheld + + # Indicates whether the employee is exempt from withholding. + attr_accessor :box7_exempt_from_withholding + + # The office code associated with the form. + attr_accessor :office_code + + # The birthday of the individual associated with the form. + attr_accessor :birthday + + # Indicates whether a foreign TIN is not required. + attr_accessor :foreign_tin_not_required + + # Indicates whether the form is archived. + attr_accessor :archived + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # The capacity in which the signer is signing the form. + attr_accessor :signer_capacity + + # The last updated date of the form. + attr_accessor :updated_at + + # The employer identification number (EIN). + attr_accessor :ein + + # The type of employer identification number (EIN). + attr_accessor :ein_type + + # Indicates certification for box 14. + attr_accessor :certify_box14 + + # Indicates certification for box 15A. + attr_accessor :certify_box15_a + + # Indicates certification for box 15B. + attr_accessor :certify_box15_b + + # Indicates certification for box 15C. + attr_accessor :certify_box15_c + + # Indicates certification for box 15D. + attr_accessor :certify_box15_d + + # Indicates certification for box 15E. + attr_accessor :certify_box15_e + + # Indicates certification for box 15F. + attr_accessor :certify_box15_f + + # Indicates certification for box 15G. + attr_accessor :certify_box15_g + + # Indicates certification for box 15H. + attr_accessor :certify_box15_h + + # Indicates certification for box 15I. + attr_accessor :certify_box15_i + + # Indicates certification for box 16A. + attr_accessor :certify_box16_a + + # Indicates certification for box 16B as a QDD corporate entity. + attr_accessor :box16_b_qdd_corporate + + # Indicates certification for box 16B as a QDD partnership. + attr_accessor :box16_b_qdd_partnership + + # Indicates certification for box 16B as a QDD disregarded entity. + attr_accessor :box16_b_qdd_disregarded_entity + + # Indicates certification for box 17A. + attr_accessor :certify_box17_a + + # Indicates certification for box 17B. + attr_accessor :certify_box17_b + + # Indicates certification for box 17C. + attr_accessor :certify_box17_c + + # Indicates certification for box 17D. + attr_accessor :certify_box17_d + + # Indicates certification for box 17E. + attr_accessor :certify_box17_e + + # Indicates certification for box 18A. + attr_accessor :certify_box18_a + + # Indicates certification for box 18B. + attr_accessor :certify_box18_b + + # Indicates certification for box 18C. + attr_accessor :certify_box18_c + + # Indicates certification for box 18D. + attr_accessor :certify_box18_d + + # Indicates certification for box 18E. + attr_accessor :certify_box18_e + + # Indicates certification for box 18F. + attr_accessor :certify_box18_f + + # Indicates certification for box 19A. + attr_accessor :certify_box19_a + + # Indicates certification for box 19B. + attr_accessor :certify_box19_b + + # Indicates certification for box 19C. + attr_accessor :certify_box19_c + + # Indicates certification for box 19D. + attr_accessor :certify_box19_d + + # Indicates certification for box 19E. + attr_accessor :certify_box19_e + + # Indicates certification for box 19F. + attr_accessor :certify_box19_f + + # Indicates certification for box 20. + attr_accessor :certify_box20 + + # Indicates certification for box 21A. + attr_accessor :certify_box21_a + + # Indicates certification for box 21B. + attr_accessor :certify_box21_b + + # Indicates certification for box 21C. + attr_accessor :certify_box21_c + + # Indicates certification for box 21D. + attr_accessor :certify_box21_d + + # Indicates certification for box 21E. + attr_accessor :certify_box21_e + + # Indicates certification for box 21F. + attr_accessor :certify_box21_f + + # The name of the sponsoring entity for box 23A. + attr_accessor :box23_a_name_sponsoring_entity + + # Indicates certification for box 23B. + attr_accessor :certify_box23_b + + # Indicates certification for box 23C. + attr_accessor :certify_box23_c + + # Indicates certification for box 25. + attr_accessor :certify_box25 + + # The name of the sponsoring entity for box 27A. + attr_accessor :box27_a_name_sponsoring_entity + + # Indicates certification for box 27B. + attr_accessor :certify_box27_b + + # Indicates certification for box 28. + attr_accessor :certify_box28 + + # Indicates certification for box 29. + attr_accessor :certify_box29 + + # Indicates certification for box 30A. + attr_accessor :certify_box30_a + + # Indicates certification for box 30B. + attr_accessor :certify_box30_b + + # Indicates certification for box 30C. + attr_accessor :certify_box30_c + + # The IGA country information for box 32. + attr_accessor :box32_iga_country + + # The IGA type information for box 32. + attr_accessor :box32_iga_type + + # The IGA treatment information for box 32. + attr_accessor :box32_iga_treated_as + + # The trustee or sponsor information for box 32. + attr_accessor :box32_trustee_or_sponsor + + # Indicates whether the trustee is foreign for box 32. + attr_accessor :box32_trustee_is_foreign + + # Indicates certification for box 33A. + attr_accessor :certify_box33_a + + # Indicates certification for box 33B. + attr_accessor :certify_box33_b + + # Indicates certification for box 33C. + attr_accessor :certify_box33_c + + # Indicates certification for box 33D. + attr_accessor :certify_box33_d + + # Indicates certification for box 33E. + attr_accessor :certify_box33_e + + # Indicates certification for box 33F. + attr_accessor :certify_box33_f + + # The securities market information for box 37A. + attr_accessor :box37_a_securities_market + + # The name of the entity for box 37B. + attr_accessor :box37_b_name_of_entity + + # The securities market information for box 37B. + attr_accessor :box37_b_securities_market + + # Indicates certification for box 40. + attr_accessor :certify_box40 + + # The sponsoring entity information for box 41. + attr_accessor :box41_sponsoring_entity + + # Indicates certification for box 42. + attr_accessor :certify_box42 + + attr_accessor :box35_formed_on_date + + attr_accessor :box36_filed_on_date + + # The status of the TIN match. + attr_accessor :tin_match_status + + # The signature itself + attr_accessor :signature + + # The classification of the business. + attr_accessor :business_classification + + # The name of the business associated with the form. + attr_accessor :business_name + + attr_accessor :business_other + + attr_accessor :exempt_payee_code + + attr_accessor :exempt_fatca_code + + # The account number associated with the form. + attr_accessor :account_number + + # Indicates whether the individual or entity is in a foreign country. + attr_accessor :foreign_country_indicator + + # The foreign address of the individual or entity. + attr_accessor :foreign_address + + # Indicates whether backup withholding applies. + attr_accessor :backup_withholding + + attr_accessor :is1099able + + # Indicates whether the individual is a foreign partner, owner, or beneficiary. + attr_accessor :foreign_partner_owner_or_beneficiary + + 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', + :'signed_date' => :'signedDate', + :'disregarded_entity_chapter4_fatca_status' => :'disregardedEntityChapter4FatcaStatus', + :'created_at' => :'createdAt', + :'name' => :'name', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_postal_code' => :'residencePostalCode', + :'residence_country' => :'residenceCountry', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_postal_code' => :'mailingPostalCode', + :'mailing_country' => :'mailingCountry', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_postal_code' => :'disregardedPostalCode', + :'disregarded_country' => :'disregardedCountry', + :'tin' => :'tin', + :'type_of_tin' => :'typeOfTin', + :'foreign_tin' => :'foreignTin', + :'ftin_not_required' => :'ftinNotRequired', + :'reference_number' => :'referenceNumber', + :'giin' => :'giin', + :'chapter3_entity_type' => :'chapter3EntityType', + :'chapter4_fatca_status' => :'chapter4FatcaStatus', + :'disregarded_entity' => :'disregardedEntity', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'benefit_limitation' => :'benefitLimitation', + :'part4_sponsoring_entity' => :'part4SponsoringEntity', + :'part4_sponsoring_entity_giin' => :'part4SponsoringEntityGiin', + :'part7_sponsoring_entity' => :'part7SponsoringEntity', + :'part12_iga_country' => :'part12IgaCountry', + :'part12_iga_type' => :'part12IgaType', + :'part12_fatca_status_under_iga_annex_ii' => :'part12FatcaStatusUnderIgaAnnexIi', + :'part12_trustee_name' => :'part12TrusteeName', + :'part12_trustee_is_foreign' => :'part12TrusteeIsForeign', + :'part12_model2_iga_giin' => :'part12Model2IgaGiin', + :'box37_a_exchange' => :'box37AExchange', + :'box37_b_exchange' => :'box37BExchange', + :'box37_b_entity' => :'box37BEntity', + :'part28_sponsoring_entity' => :'part28SponsoringEntity', + :'part28_sponsoring_entity_giin' => :'part28SponsoringEntityGiin', + :'signer_name' => :'signerName', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'residence_is_mailing' => :'residenceIsMailing', + :'citizenship_country' => :'citizenshipCountry', + :'making_treaty_claim' => :'makingTreatyClaim', + :'treaty_country' => :'treatyCountry', + :'treaty_article' => :'treatyArticle', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'treaty_reasons' => :'treatyReasons', + :'certify_box14_a' => :'certifyBox14A', + :'certify_box14_b' => :'certifyBox14B', + :'certify_box14_c' => :'certifyBox14C', + :'certify_box17_1' => :'certifyBox17_1', + :'certify_box17_2' => :'certifyBox17_2', + :'certify_box18' => :'certifyBox18', + :'certify_box19' => :'certifyBox19', + :'certify_box21' => :'certifyBox21', + :'certify_box22' => :'certifyBox22', + :'certify_box23' => :'certifyBox23', + :'certify_box24_a' => :'certifyBox24A', + :'certify_box24_b' => :'certifyBox24B', + :'certify_box24_c' => :'certifyBox24C', + :'certify_box24_d' => :'certifyBox24D', + :'certify_box25_a' => :'certifyBox25A', + :'certify_box25_b' => :'certifyBox25B', + :'certify_box25_c' => :'certifyBox25C', + :'certify_box26' => :'certifyBox26', + :'certify_box27' => :'certifyBox27', + :'certify_box28_a' => :'certifyBox28A', + :'certify_box28_b' => :'certifyBox28B', + :'certify_box29_a' => :'certifyBox29A', + :'certify_box29_b' => :'certifyBox29B', + :'certify_box29_c' => :'certifyBox29C', + :'certify_box29_d' => :'certifyBox29D', + :'certify_box29_e' => :'certifyBox29E', + :'certify_box29_f' => :'certifyBox29F', + :'certify_box30' => :'certifyBox30', + :'certify_box31' => :'certifyBox31', + :'certify_box32' => :'certifyBox32', + :'certify_box33' => :'certifyBox33', + :'certify_box34' => :'certifyBox34', + :'certify_box35' => :'certifyBox35', + :'certify_box36' => :'certifyBox36', + :'certify_box37_a' => :'certifyBox37A', + :'certify_box37_b' => :'certifyBox37B', + :'certify_box38' => :'certifyBox38', + :'certify_box39' => :'certifyBox39', + :'certify_box40_a' => :'certifyBox40A', + :'certify_box40_b' => :'certifyBox40B', + :'certify_box40_c' => :'certifyBox40C', + :'certify_box41' => :'certifyBox41', + :'certify_box43' => :'certifyBox43', + :'certify_part29_signature' => :'certifyPart29Signature', + :'part19_formation_or_resolution_date' => :'part19FormationOrResolutionDate', + :'part20_filing_date' => :'part20FilingDate', + :'part21_determination_date' => :'part21DeterminationDate', + :'substantial_us_owners' => :'substantialUsOwners', + :'employee_first_name' => :'employeeFirstName', + :'employee_middle_name' => :'employeeMiddleName', + :'employee_last_name' => :'employeeLastName', + :'employee_name_suffix' => :'employeeNameSuffix', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'box3_marital_status' => :'box3MaritalStatus', + :'box4_last_name_differs' => :'box4LastNameDiffers', + :'box5_num_allowances' => :'box5NumAllowances', + :'other_dependents' => :'otherDependents', + :'non_job_income' => :'nonJobIncome', + :'deductions' => :'deductions', + :'box6_additional_withheld' => :'box6AdditionalWithheld', + :'box7_exempt_from_withholding' => :'box7ExemptFromWithholding', + :'office_code' => :'officeCode', + :'birthday' => :'birthday', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'archived' => :'archived', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'signer_capacity' => :'signerCapacity', + :'updated_at' => :'updatedAt', + :'ein' => :'ein', + :'ein_type' => :'einType', + :'certify_box14' => :'certifyBox14', + :'certify_box15_a' => :'certifyBox15A', + :'certify_box15_b' => :'certifyBox15B', + :'certify_box15_c' => :'certifyBox15C', + :'certify_box15_d' => :'certifyBox15D', + :'certify_box15_e' => :'certifyBox15E', + :'certify_box15_f' => :'certifyBox15F', + :'certify_box15_g' => :'certifyBox15G', + :'certify_box15_h' => :'certifyBox15H', + :'certify_box15_i' => :'certifyBox15I', + :'certify_box16_a' => :'certifyBox16A', + :'box16_b_qdd_corporate' => :'box16BQddCorporate', + :'box16_b_qdd_partnership' => :'box16BQddPartnership', + :'box16_b_qdd_disregarded_entity' => :'box16BQddDisregardedEntity', + :'certify_box17_a' => :'certifyBox17A', + :'certify_box17_b' => :'certifyBox17B', + :'certify_box17_c' => :'certifyBox17C', + :'certify_box17_d' => :'certifyBox17D', + :'certify_box17_e' => :'certifyBox17E', + :'certify_box18_a' => :'certifyBox18A', + :'certify_box18_b' => :'certifyBox18B', + :'certify_box18_c' => :'certifyBox18C', + :'certify_box18_d' => :'certifyBox18D', + :'certify_box18_e' => :'certifyBox18E', + :'certify_box18_f' => :'certifyBox18F', + :'certify_box19_a' => :'certifyBox19A', + :'certify_box19_b' => :'certifyBox19B', + :'certify_box19_c' => :'certifyBox19C', + :'certify_box19_d' => :'certifyBox19D', + :'certify_box19_e' => :'certifyBox19E', + :'certify_box19_f' => :'certifyBox19F', + :'certify_box20' => :'certifyBox20', + :'certify_box21_a' => :'certifyBox21A', + :'certify_box21_b' => :'certifyBox21B', + :'certify_box21_c' => :'certifyBox21C', + :'certify_box21_d' => :'certifyBox21D', + :'certify_box21_e' => :'certifyBox21E', + :'certify_box21_f' => :'certifyBox21F', + :'box23_a_name_sponsoring_entity' => :'box23ANameSponsoringEntity', + :'certify_box23_b' => :'certifyBox23B', + :'certify_box23_c' => :'certifyBox23C', + :'certify_box25' => :'certifyBox25', + :'box27_a_name_sponsoring_entity' => :'box27ANameSponsoringEntity', + :'certify_box27_b' => :'certifyBox27B', + :'certify_box28' => :'certifyBox28', + :'certify_box29' => :'certifyBox29', + :'certify_box30_a' => :'certifyBox30A', + :'certify_box30_b' => :'certifyBox30B', + :'certify_box30_c' => :'certifyBox30C', + :'box32_iga_country' => :'box32IgaCountry', + :'box32_iga_type' => :'box32IgaType', + :'box32_iga_treated_as' => :'box32IgaTreatedAs', + :'box32_trustee_or_sponsor' => :'box32TrusteeOrSponsor', + :'box32_trustee_is_foreign' => :'box32TrusteeIsForeign', + :'certify_box33_a' => :'certifyBox33A', + :'certify_box33_b' => :'certifyBox33B', + :'certify_box33_c' => :'certifyBox33C', + :'certify_box33_d' => :'certifyBox33D', + :'certify_box33_e' => :'certifyBox33E', + :'certify_box33_f' => :'certifyBox33F', + :'box37_a_securities_market' => :'box37ASecuritiesMarket', + :'box37_b_name_of_entity' => :'box37BNameOfEntity', + :'box37_b_securities_market' => :'box37BSecuritiesMarket', + :'certify_box40' => :'certifyBox40', + :'box41_sponsoring_entity' => :'box41SponsoringEntity', + :'certify_box42' => :'certifyBox42', + :'box35_formed_on_date' => :'box35FormedOnDate', + :'box36_filed_on_date' => :'box36FiledOnDate', + :'tin_match_status' => :'tinMatchStatus', + :'signature' => :'signature', + :'business_classification' => :'businessClassification', + :'business_name' => :'businessName', + :'business_other' => :'businessOther', + :'exempt_payee_code' => :'exemptPayeeCode', + :'exempt_fatca_code' => :'exemptFatcaCode', + :'account_number' => :'accountNumber', + :'foreign_country_indicator' => :'foreignCountryIndicator', + :'foreign_address' => :'foreignAddress', + :'backup_withholding' => :'backupWithholding', + :'is1099able' => :'is1099able', + :'foreign_partner_owner_or_beneficiary' => :'foreignPartnerOwnerOrBeneficiary' + } + 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', + :'signed_date' => :'Time', + :'disregarded_entity_chapter4_fatca_status' => :'String', + :'created_at' => :'Time', + :'name' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_postal_code' => :'String', + :'residence_country' => :'String', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_postal_code' => :'String', + :'mailing_country' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_postal_code' => :'String', + :'disregarded_country' => :'String', + :'tin' => :'String', + :'type_of_tin' => :'String', + :'foreign_tin' => :'String', + :'ftin_not_required' => :'Boolean', + :'reference_number' => :'String', + :'giin' => :'String', + :'chapter3_entity_type' => :'String', + :'chapter4_fatca_status' => :'String', + :'disregarded_entity' => :'String', + :'disregarded_entity_giin' => :'String', + :'benefit_limitation' => :'String', + :'part4_sponsoring_entity' => :'String', + :'part4_sponsoring_entity_giin' => :'String', + :'part7_sponsoring_entity' => :'String', + :'part12_iga_country' => :'String', + :'part12_iga_type' => :'String', + :'part12_fatca_status_under_iga_annex_ii' => :'String', + :'part12_trustee_name' => :'String', + :'part12_trustee_is_foreign' => :'Boolean', + :'part12_model2_iga_giin' => :'String', + :'box37_a_exchange' => :'String', + :'box37_b_exchange' => :'String', + :'box37_b_entity' => :'String', + :'part28_sponsoring_entity' => :'String', + :'part28_sponsoring_entity_giin' => :'String', + :'signer_name' => :'String', + :'e_delivery_consented_at' => :'Time', + :'residence_is_mailing' => :'Boolean', + :'citizenship_country' => :'String', + :'making_treaty_claim' => :'Boolean', + :'treaty_country' => :'String', + :'treaty_article' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'treaty_reasons' => :'String', + :'certify_box14_a' => :'Boolean', + :'certify_box14_b' => :'Boolean', + :'certify_box14_c' => :'Boolean', + :'certify_box17_1' => :'Boolean', + :'certify_box17_2' => :'Boolean', + :'certify_box18' => :'Boolean', + :'certify_box19' => :'Boolean', + :'certify_box21' => :'Boolean', + :'certify_box22' => :'Boolean', + :'certify_box23' => :'Boolean', + :'certify_box24_a' => :'Boolean', + :'certify_box24_b' => :'Boolean', + :'certify_box24_c' => :'Boolean', + :'certify_box24_d' => :'Boolean', + :'certify_box25_a' => :'Boolean', + :'certify_box25_b' => :'Boolean', + :'certify_box25_c' => :'Boolean', + :'certify_box26' => :'Boolean', + :'certify_box27' => :'Boolean', + :'certify_box28_a' => :'Boolean', + :'certify_box28_b' => :'Boolean', + :'certify_box29_a' => :'Boolean', + :'certify_box29_b' => :'Boolean', + :'certify_box29_c' => :'Boolean', + :'certify_box29_d' => :'Boolean', + :'certify_box29_e' => :'Boolean', + :'certify_box29_f' => :'Boolean', + :'certify_box30' => :'Boolean', + :'certify_box31' => :'Boolean', + :'certify_box32' => :'Boolean', + :'certify_box33' => :'Boolean', + :'certify_box34' => :'Boolean', + :'certify_box35' => :'Boolean', + :'certify_box36' => :'Boolean', + :'certify_box37_a' => :'Boolean', + :'certify_box37_b' => :'Boolean', + :'certify_box38' => :'Boolean', + :'certify_box39' => :'Boolean', + :'certify_box40_a' => :'Boolean', + :'certify_box40_b' => :'Boolean', + :'certify_box40_c' => :'Boolean', + :'certify_box41' => :'Boolean', + :'certify_box43' => :'Boolean', + :'certify_part29_signature' => :'Boolean', + :'part19_formation_or_resolution_date' => :'Time', + :'part20_filing_date' => :'Time', + :'part21_determination_date' => :'Time', + :'substantial_us_owners' => :'Array', + :'employee_first_name' => :'String', + :'employee_middle_name' => :'String', + :'employee_last_name' => :'String', + :'employee_name_suffix' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'box3_marital_status' => :'String', + :'box4_last_name_differs' => :'Boolean', + :'box5_num_allowances' => :'Integer', + :'other_dependents' => :'Integer', + :'non_job_income' => :'Float', + :'deductions' => :'Float', + :'box6_additional_withheld' => :'Float', + :'box7_exempt_from_withholding' => :'Boolean', + :'office_code' => :'String', + :'birthday' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'archived' => :'Boolean', + :'reference_id' => :'String', + :'company_id' => :'Integer', + :'display_name' => :'String', + :'email' => :'String', + :'signer_capacity' => :'String', + :'updated_at' => :'Time', + :'ein' => :'String', + :'ein_type' => :'String', + :'certify_box14' => :'Boolean', + :'certify_box15_a' => :'Boolean', + :'certify_box15_b' => :'Boolean', + :'certify_box15_c' => :'Boolean', + :'certify_box15_d' => :'Boolean', + :'certify_box15_e' => :'Boolean', + :'certify_box15_f' => :'Boolean', + :'certify_box15_g' => :'Boolean', + :'certify_box15_h' => :'Boolean', + :'certify_box15_i' => :'Boolean', + :'certify_box16_a' => :'Boolean', + :'box16_b_qdd_corporate' => :'Boolean', + :'box16_b_qdd_partnership' => :'Boolean', + :'box16_b_qdd_disregarded_entity' => :'Boolean', + :'certify_box17_a' => :'Boolean', + :'certify_box17_b' => :'Boolean', + :'certify_box17_c' => :'Boolean', + :'certify_box17_d' => :'Boolean', + :'certify_box17_e' => :'Boolean', + :'certify_box18_a' => :'Boolean', + :'certify_box18_b' => :'Boolean', + :'certify_box18_c' => :'Boolean', + :'certify_box18_d' => :'Boolean', + :'certify_box18_e' => :'Boolean', + :'certify_box18_f' => :'Boolean', + :'certify_box19_a' => :'Boolean', + :'certify_box19_b' => :'Boolean', + :'certify_box19_c' => :'Boolean', + :'certify_box19_d' => :'Boolean', + :'certify_box19_e' => :'Boolean', + :'certify_box19_f' => :'Boolean', + :'certify_box20' => :'Boolean', + :'certify_box21_a' => :'Boolean', + :'certify_box21_b' => :'Boolean', + :'certify_box21_c' => :'Boolean', + :'certify_box21_d' => :'Boolean', + :'certify_box21_e' => :'Boolean', + :'certify_box21_f' => :'Boolean', + :'box23_a_name_sponsoring_entity' => :'String', + :'certify_box23_b' => :'Boolean', + :'certify_box23_c' => :'Boolean', + :'certify_box25' => :'Boolean', + :'box27_a_name_sponsoring_entity' => :'String', + :'certify_box27_b' => :'Boolean', + :'certify_box28' => :'Boolean', + :'certify_box29' => :'Boolean', + :'certify_box30_a' => :'Boolean', + :'certify_box30_b' => :'Boolean', + :'certify_box30_c' => :'Boolean', + :'box32_iga_country' => :'String', + :'box32_iga_type' => :'String', + :'box32_iga_treated_as' => :'String', + :'box32_trustee_or_sponsor' => :'String', + :'box32_trustee_is_foreign' => :'Boolean', + :'certify_box33_a' => :'Boolean', + :'certify_box33_b' => :'Boolean', + :'certify_box33_c' => :'Boolean', + :'certify_box33_d' => :'Boolean', + :'certify_box33_e' => :'Boolean', + :'certify_box33_f' => :'Boolean', + :'box37_a_securities_market' => :'String', + :'box37_b_name_of_entity' => :'String', + :'box37_b_securities_market' => :'String', + :'certify_box40' => :'Boolean', + :'box41_sponsoring_entity' => :'String', + :'certify_box42' => :'Boolean', + :'box35_formed_on_date' => :'Time', + :'box36_filed_on_date' => :'Time', + :'tin_match_status' => :'String', + :'signature' => :'String', + :'business_classification' => :'String', + :'business_name' => :'String', + :'business_other' => :'String', + :'exempt_payee_code' => :'String', + :'exempt_fatca_code' => :'String', + :'account_number' => :'String', + :'foreign_country_indicator' => :'Boolean', + :'foreign_address' => :'String', + :'backup_withholding' => :'Boolean', + :'is1099able' => :'Boolean', + :'foreign_partner_owner_or_beneficiary' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'signed_date', + :'disregarded_entity_chapter4_fatca_status', + :'created_at', + :'name', + :'residence_address', + :'residence_city', + :'residence_state', + :'residence_postal_code', + :'residence_country', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_postal_code', + :'mailing_country', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_postal_code', + :'disregarded_country', + :'tin', + :'type_of_tin', + :'foreign_tin', + :'ftin_not_required', + :'reference_number', + :'giin', + :'chapter3_entity_type', + :'chapter4_fatca_status', + :'disregarded_entity', + :'disregarded_entity_giin', + :'benefit_limitation', + :'part4_sponsoring_entity', + :'part4_sponsoring_entity_giin', + :'part7_sponsoring_entity', + :'part12_iga_country', + :'part12_iga_type', + :'part12_fatca_status_under_iga_annex_ii', + :'part12_trustee_name', + :'part12_trustee_is_foreign', + :'part12_model2_iga_giin', + :'box37_a_exchange', + :'box37_b_exchange', + :'box37_b_entity', + :'part28_sponsoring_entity', + :'part28_sponsoring_entity_giin', + :'signer_name', + :'e_delivery_consented_at', + :'residence_is_mailing', + :'citizenship_country', + :'making_treaty_claim', + :'treaty_country', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'part19_formation_or_resolution_date', + :'part20_filing_date', + :'part21_determination_date', + :'employee_first_name', + :'employee_middle_name', + :'employee_last_name', + :'employee_name_suffix', + :'address', + :'city', + :'state', + :'zip', + :'box3_marital_status', + :'box4_last_name_differs', + :'box5_num_allowances', + :'other_dependents', + :'non_job_income', + :'deductions', + :'box6_additional_withheld', + :'box7_exempt_from_withholding', + :'office_code', + :'birthday', + :'foreign_tin_not_required', + :'archived', + :'reference_id', + :'company_id', + :'display_name', + :'email', + :'signer_capacity', + :'updated_at', + :'ein', + :'ein_type', + :'box23_a_name_sponsoring_entity', + :'box27_a_name_sponsoring_entity', + :'box32_iga_country', + :'box32_iga_type', + :'box32_iga_treated_as', + :'box32_trustee_or_sponsor', + :'box37_a_securities_market', + :'box37_b_name_of_entity', + :'box37_b_securities_market', + :'box41_sponsoring_entity', + :'box35_formed_on_date', + :'box36_filed_on_date', + :'tin_match_status', + :'signature', + :'business_classification', + :'business_name', + :'business_other', + :'exempt_payee_code', + :'exempt_fatca_code', + :'account_number', + :'foreign_country_indicator', + :'foreign_address', + :'backup_withholding', + :'is1099able', + :'foreign_partner_owner_or_beneficiary' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'IW9FormDataModelsOneOf' + ] + 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::W8BeneFormDataModel` 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::W8BeneFormDataModel`. 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?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'disregarded_entity_chapter4_fatca_status') + self.disregarded_entity_chapter4_fatca_status = attributes[:'disregarded_entity_chapter4_fatca_status'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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_postal_code') + self.residence_postal_code = attributes[:'residence_postal_code'] + end + + if attributes.key?(:'residence_country') + self.residence_country = attributes[:'residence_country'] + 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_postal_code') + self.mailing_postal_code = attributes[:'mailing_postal_code'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + 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_postal_code') + self.disregarded_postal_code = attributes[:'disregarded_postal_code'] + end + + if attributes.key?(:'disregarded_country') + self.disregarded_country = attributes[:'disregarded_country'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'ftin_not_required') + self.ftin_not_required = attributes[:'ftin_not_required'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'chapter3_entity_type') + self.chapter3_entity_type = attributes[:'chapter3_entity_type'] + end + + if attributes.key?(:'chapter4_fatca_status') + self.chapter4_fatca_status = attributes[:'chapter4_fatca_status'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + end + + if attributes.key?(:'disregarded_entity_giin') + self.disregarded_entity_giin = attributes[:'disregarded_entity_giin'] + end + + if attributes.key?(:'benefit_limitation') + self.benefit_limitation = attributes[:'benefit_limitation'] + end + + if attributes.key?(:'part4_sponsoring_entity') + self.part4_sponsoring_entity = attributes[:'part4_sponsoring_entity'] + end + + if attributes.key?(:'part4_sponsoring_entity_giin') + self.part4_sponsoring_entity_giin = attributes[:'part4_sponsoring_entity_giin'] + end + + if attributes.key?(:'part7_sponsoring_entity') + self.part7_sponsoring_entity = attributes[:'part7_sponsoring_entity'] + end + + if attributes.key?(:'part12_iga_country') + self.part12_iga_country = attributes[:'part12_iga_country'] + end + + if attributes.key?(:'part12_iga_type') + self.part12_iga_type = attributes[:'part12_iga_type'] + end + + if attributes.key?(:'part12_fatca_status_under_iga_annex_ii') + self.part12_fatca_status_under_iga_annex_ii = attributes[:'part12_fatca_status_under_iga_annex_ii'] + end + + if attributes.key?(:'part12_trustee_name') + self.part12_trustee_name = attributes[:'part12_trustee_name'] + end + + if attributes.key?(:'part12_trustee_is_foreign') + self.part12_trustee_is_foreign = attributes[:'part12_trustee_is_foreign'] + end + + if attributes.key?(:'part12_model2_iga_giin') + self.part12_model2_iga_giin = attributes[:'part12_model2_iga_giin'] + end + + if attributes.key?(:'box37_a_exchange') + self.box37_a_exchange = attributes[:'box37_a_exchange'] + end + + if attributes.key?(:'box37_b_exchange') + self.box37_b_exchange = attributes[:'box37_b_exchange'] + end + + if attributes.key?(:'box37_b_entity') + self.box37_b_entity = attributes[:'box37_b_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity') + self.part28_sponsoring_entity = attributes[:'part28_sponsoring_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity_giin') + self.part28_sponsoring_entity_giin = attributes[:'part28_sponsoring_entity_giin'] + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'residence_is_mailing') + self.residence_is_mailing = attributes[:'residence_is_mailing'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + end + + if attributes.key?(:'making_treaty_claim') + self.making_treaty_claim = attributes[:'making_treaty_claim'] + 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?(:'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?(:'certify_box14_a') + self.certify_box14_a = attributes[:'certify_box14_a'] + end + + if attributes.key?(:'certify_box14_b') + self.certify_box14_b = attributes[:'certify_box14_b'] + end + + if attributes.key?(:'certify_box14_c') + self.certify_box14_c = attributes[:'certify_box14_c'] + end + + if attributes.key?(:'certify_box17_1') + self.certify_box17_1 = attributes[:'certify_box17_1'] + end + + if attributes.key?(:'certify_box17_2') + self.certify_box17_2 = attributes[:'certify_box17_2'] + end + + if attributes.key?(:'certify_box18') + self.certify_box18 = attributes[:'certify_box18'] + end + + if attributes.key?(:'certify_box19') + self.certify_box19 = attributes[:'certify_box19'] + end + + if attributes.key?(:'certify_box21') + self.certify_box21 = attributes[:'certify_box21'] + end + + if attributes.key?(:'certify_box22') + self.certify_box22 = attributes[:'certify_box22'] + end + + if attributes.key?(:'certify_box23') + self.certify_box23 = attributes[:'certify_box23'] + end + + if attributes.key?(:'certify_box24_a') + self.certify_box24_a = attributes[:'certify_box24_a'] + end + + if attributes.key?(:'certify_box24_b') + self.certify_box24_b = attributes[:'certify_box24_b'] + end + + if attributes.key?(:'certify_box24_c') + self.certify_box24_c = attributes[:'certify_box24_c'] + end + + if attributes.key?(:'certify_box24_d') + self.certify_box24_d = attributes[:'certify_box24_d'] + end + + if attributes.key?(:'certify_box25_a') + self.certify_box25_a = attributes[:'certify_box25_a'] + end + + if attributes.key?(:'certify_box25_b') + self.certify_box25_b = attributes[:'certify_box25_b'] + end + + if attributes.key?(:'certify_box25_c') + self.certify_box25_c = attributes[:'certify_box25_c'] + end + + if attributes.key?(:'certify_box26') + self.certify_box26 = attributes[:'certify_box26'] + end + + if attributes.key?(:'certify_box27') + self.certify_box27 = attributes[:'certify_box27'] + end + + if attributes.key?(:'certify_box28_a') + self.certify_box28_a = attributes[:'certify_box28_a'] + end + + if attributes.key?(:'certify_box28_b') + self.certify_box28_b = attributes[:'certify_box28_b'] + end + + if attributes.key?(:'certify_box29_a') + self.certify_box29_a = attributes[:'certify_box29_a'] + end + + if attributes.key?(:'certify_box29_b') + self.certify_box29_b = attributes[:'certify_box29_b'] + end + + if attributes.key?(:'certify_box29_c') + self.certify_box29_c = attributes[:'certify_box29_c'] + end + + if attributes.key?(:'certify_box29_d') + self.certify_box29_d = attributes[:'certify_box29_d'] + end + + if attributes.key?(:'certify_box29_e') + self.certify_box29_e = attributes[:'certify_box29_e'] + end + + if attributes.key?(:'certify_box29_f') + self.certify_box29_f = attributes[:'certify_box29_f'] + end + + if attributes.key?(:'certify_box30') + self.certify_box30 = attributes[:'certify_box30'] + end + + if attributes.key?(:'certify_box31') + self.certify_box31 = attributes[:'certify_box31'] + end + + if attributes.key?(:'certify_box32') + self.certify_box32 = attributes[:'certify_box32'] + end + + if attributes.key?(:'certify_box33') + self.certify_box33 = attributes[:'certify_box33'] + end + + if attributes.key?(:'certify_box34') + self.certify_box34 = attributes[:'certify_box34'] + end + + if attributes.key?(:'certify_box35') + self.certify_box35 = attributes[:'certify_box35'] + end + + if attributes.key?(:'certify_box36') + self.certify_box36 = attributes[:'certify_box36'] + end + + if attributes.key?(:'certify_box37_a') + self.certify_box37_a = attributes[:'certify_box37_a'] + end + + if attributes.key?(:'certify_box37_b') + self.certify_box37_b = attributes[:'certify_box37_b'] + end + + if attributes.key?(:'certify_box38') + self.certify_box38 = attributes[:'certify_box38'] + end + + if attributes.key?(:'certify_box39') + self.certify_box39 = attributes[:'certify_box39'] + end + + if attributes.key?(:'certify_box40_a') + self.certify_box40_a = attributes[:'certify_box40_a'] + end + + if attributes.key?(:'certify_box40_b') + self.certify_box40_b = attributes[:'certify_box40_b'] + end + + if attributes.key?(:'certify_box40_c') + self.certify_box40_c = attributes[:'certify_box40_c'] + end + + if attributes.key?(:'certify_box41') + self.certify_box41 = attributes[:'certify_box41'] + end + + if attributes.key?(:'certify_box43') + self.certify_box43 = attributes[:'certify_box43'] + end + + if attributes.key?(:'certify_part29_signature') + self.certify_part29_signature = attributes[:'certify_part29_signature'] + end + + if attributes.key?(:'part19_formation_or_resolution_date') + self.part19_formation_or_resolution_date = attributes[:'part19_formation_or_resolution_date'] + end + + if attributes.key?(:'part20_filing_date') + self.part20_filing_date = attributes[:'part20_filing_date'] + end + + if attributes.key?(:'part21_determination_date') + self.part21_determination_date = attributes[:'part21_determination_date'] + 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?(:'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?(:'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?(:'box3_marital_status') + self.box3_marital_status = attributes[:'box3_marital_status'] + end + + if attributes.key?(:'box4_last_name_differs') + self.box4_last_name_differs = attributes[:'box4_last_name_differs'] + end + + if attributes.key?(:'box5_num_allowances') + self.box5_num_allowances = attributes[:'box5_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?(:'box6_additional_withheld') + self.box6_additional_withheld = attributes[:'box6_additional_withheld'] + end + + if attributes.key?(:'box7_exempt_from_withholding') + self.box7_exempt_from_withholding = attributes[:'box7_exempt_from_withholding'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'birthday') + self.birthday = attributes[:'birthday'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'signer_capacity') + self.signer_capacity = attributes[:'signer_capacity'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'ein_type') + self.ein_type = attributes[:'ein_type'] + end + + if attributes.key?(:'certify_box14') + self.certify_box14 = attributes[:'certify_box14'] + end + + if attributes.key?(:'certify_box15_a') + self.certify_box15_a = attributes[:'certify_box15_a'] + end + + if attributes.key?(:'certify_box15_b') + self.certify_box15_b = attributes[:'certify_box15_b'] + end + + if attributes.key?(:'certify_box15_c') + self.certify_box15_c = attributes[:'certify_box15_c'] + end + + if attributes.key?(:'certify_box15_d') + self.certify_box15_d = attributes[:'certify_box15_d'] + end + + if attributes.key?(:'certify_box15_e') + self.certify_box15_e = attributes[:'certify_box15_e'] + end + + if attributes.key?(:'certify_box15_f') + self.certify_box15_f = attributes[:'certify_box15_f'] + end + + if attributes.key?(:'certify_box15_g') + self.certify_box15_g = attributes[:'certify_box15_g'] + end + + if attributes.key?(:'certify_box15_h') + self.certify_box15_h = attributes[:'certify_box15_h'] + end + + if attributes.key?(:'certify_box15_i') + self.certify_box15_i = attributes[:'certify_box15_i'] + end + + if attributes.key?(:'certify_box16_a') + self.certify_box16_a = attributes[:'certify_box16_a'] + end + + if attributes.key?(:'box16_b_qdd_corporate') + self.box16_b_qdd_corporate = attributes[:'box16_b_qdd_corporate'] + end + + if attributes.key?(:'box16_b_qdd_partnership') + self.box16_b_qdd_partnership = attributes[:'box16_b_qdd_partnership'] + end + + if attributes.key?(:'box16_b_qdd_disregarded_entity') + self.box16_b_qdd_disregarded_entity = attributes[:'box16_b_qdd_disregarded_entity'] + end + + if attributes.key?(:'certify_box17_a') + self.certify_box17_a = attributes[:'certify_box17_a'] + end + + if attributes.key?(:'certify_box17_b') + self.certify_box17_b = attributes[:'certify_box17_b'] + end + + if attributes.key?(:'certify_box17_c') + self.certify_box17_c = attributes[:'certify_box17_c'] + end + + if attributes.key?(:'certify_box17_d') + self.certify_box17_d = attributes[:'certify_box17_d'] + end + + if attributes.key?(:'certify_box17_e') + self.certify_box17_e = attributes[:'certify_box17_e'] + end + + if attributes.key?(:'certify_box18_a') + self.certify_box18_a = attributes[:'certify_box18_a'] + end + + if attributes.key?(:'certify_box18_b') + self.certify_box18_b = attributes[:'certify_box18_b'] + end + + if attributes.key?(:'certify_box18_c') + self.certify_box18_c = attributes[:'certify_box18_c'] + end + + if attributes.key?(:'certify_box18_d') + self.certify_box18_d = attributes[:'certify_box18_d'] + end + + if attributes.key?(:'certify_box18_e') + self.certify_box18_e = attributes[:'certify_box18_e'] + end + + if attributes.key?(:'certify_box18_f') + self.certify_box18_f = attributes[:'certify_box18_f'] + end + + if attributes.key?(:'certify_box19_a') + self.certify_box19_a = attributes[:'certify_box19_a'] + end + + if attributes.key?(:'certify_box19_b') + self.certify_box19_b = attributes[:'certify_box19_b'] + end + + if attributes.key?(:'certify_box19_c') + self.certify_box19_c = attributes[:'certify_box19_c'] + end + + if attributes.key?(:'certify_box19_d') + self.certify_box19_d = attributes[:'certify_box19_d'] + end + + if attributes.key?(:'certify_box19_e') + self.certify_box19_e = attributes[:'certify_box19_e'] + end + + if attributes.key?(:'certify_box19_f') + self.certify_box19_f = attributes[:'certify_box19_f'] + end + + if attributes.key?(:'certify_box20') + self.certify_box20 = attributes[:'certify_box20'] + end + + if attributes.key?(:'certify_box21_a') + self.certify_box21_a = attributes[:'certify_box21_a'] + end + + if attributes.key?(:'certify_box21_b') + self.certify_box21_b = attributes[:'certify_box21_b'] + end + + if attributes.key?(:'certify_box21_c') + self.certify_box21_c = attributes[:'certify_box21_c'] + end + + if attributes.key?(:'certify_box21_d') + self.certify_box21_d = attributes[:'certify_box21_d'] + end + + if attributes.key?(:'certify_box21_e') + self.certify_box21_e = attributes[:'certify_box21_e'] + end + + if attributes.key?(:'certify_box21_f') + self.certify_box21_f = attributes[:'certify_box21_f'] + end + + if attributes.key?(:'box23_a_name_sponsoring_entity') + self.box23_a_name_sponsoring_entity = attributes[:'box23_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box23_b') + self.certify_box23_b = attributes[:'certify_box23_b'] + end + + if attributes.key?(:'certify_box23_c') + self.certify_box23_c = attributes[:'certify_box23_c'] + end + + if attributes.key?(:'certify_box25') + self.certify_box25 = attributes[:'certify_box25'] + end + + if attributes.key?(:'box27_a_name_sponsoring_entity') + self.box27_a_name_sponsoring_entity = attributes[:'box27_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box27_b') + self.certify_box27_b = attributes[:'certify_box27_b'] + end + + if attributes.key?(:'certify_box28') + self.certify_box28 = attributes[:'certify_box28'] + end + + if attributes.key?(:'certify_box29') + self.certify_box29 = attributes[:'certify_box29'] + end + + if attributes.key?(:'certify_box30_a') + self.certify_box30_a = attributes[:'certify_box30_a'] + end + + if attributes.key?(:'certify_box30_b') + self.certify_box30_b = attributes[:'certify_box30_b'] + end + + if attributes.key?(:'certify_box30_c') + self.certify_box30_c = attributes[:'certify_box30_c'] + end + + if attributes.key?(:'box32_iga_country') + self.box32_iga_country = attributes[:'box32_iga_country'] + end + + if attributes.key?(:'box32_iga_type') + self.box32_iga_type = attributes[:'box32_iga_type'] + end + + if attributes.key?(:'box32_iga_treated_as') + self.box32_iga_treated_as = attributes[:'box32_iga_treated_as'] + end + + if attributes.key?(:'box32_trustee_or_sponsor') + self.box32_trustee_or_sponsor = attributes[:'box32_trustee_or_sponsor'] + end + + if attributes.key?(:'box32_trustee_is_foreign') + self.box32_trustee_is_foreign = attributes[:'box32_trustee_is_foreign'] + end + + if attributes.key?(:'certify_box33_a') + self.certify_box33_a = attributes[:'certify_box33_a'] + end + + if attributes.key?(:'certify_box33_b') + self.certify_box33_b = attributes[:'certify_box33_b'] + end + + if attributes.key?(:'certify_box33_c') + self.certify_box33_c = attributes[:'certify_box33_c'] + end + + if attributes.key?(:'certify_box33_d') + self.certify_box33_d = attributes[:'certify_box33_d'] + end + + if attributes.key?(:'certify_box33_e') + self.certify_box33_e = attributes[:'certify_box33_e'] + end + + if attributes.key?(:'certify_box33_f') + self.certify_box33_f = attributes[:'certify_box33_f'] + end + + if attributes.key?(:'box37_a_securities_market') + self.box37_a_securities_market = attributes[:'box37_a_securities_market'] + end + + if attributes.key?(:'box37_b_name_of_entity') + self.box37_b_name_of_entity = attributes[:'box37_b_name_of_entity'] + end + + if attributes.key?(:'box37_b_securities_market') + self.box37_b_securities_market = attributes[:'box37_b_securities_market'] + end + + if attributes.key?(:'certify_box40') + self.certify_box40 = attributes[:'certify_box40'] + end + + if attributes.key?(:'box41_sponsoring_entity') + self.box41_sponsoring_entity = attributes[:'box41_sponsoring_entity'] + end + + if attributes.key?(:'certify_box42') + self.certify_box42 = attributes[:'certify_box42'] + end + + if attributes.key?(:'box35_formed_on_date') + self.box35_formed_on_date = attributes[:'box35_formed_on_date'] + end + + if attributes.key?(:'box36_filed_on_date') + self.box36_filed_on_date = attributes[:'box36_filed_on_date'] + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'business_classification') + self.business_classification = attributes[:'business_classification'] + end + + if attributes.key?(:'business_name') + self.business_name = attributes[:'business_name'] + end + + if attributes.key?(:'business_other') + self.business_other = attributes[:'business_other'] + 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?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'foreign_country_indicator') + self.foreign_country_indicator = attributes[:'foreign_country_indicator'] + end + + if attributes.key?(:'foreign_address') + self.foreign_address = attributes[:'foreign_address'] + 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?(:'foreign_partner_owner_or_beneficiary') + self.foreign_partner_owner_or_beneficiary = attributes[:'foreign_partner_owner_or_beneficiary'] + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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] substantial_us_owners Value to be assigned + def substantial_us_owners=(substantial_us_owners) + if substantial_us_owners.nil? + fail ArgumentError, 'substantial_us_owners cannot be nil' + end + + @substantial_us_owners = substantial_us_owners + 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 && + signed_date == o.signed_date && + disregarded_entity_chapter4_fatca_status == o.disregarded_entity_chapter4_fatca_status && + created_at == o.created_at && + name == o.name && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_postal_code == o.residence_postal_code && + residence_country == o.residence_country && + mailing_address == o.mailing_address && + mailing_city == o.mailing_city && + mailing_state == o.mailing_state && + mailing_postal_code == o.mailing_postal_code && + mailing_country == o.mailing_country && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_postal_code == o.disregarded_postal_code && + disregarded_country == o.disregarded_country && + tin == o.tin && + type_of_tin == o.type_of_tin && + foreign_tin == o.foreign_tin && + ftin_not_required == o.ftin_not_required && + reference_number == o.reference_number && + giin == o.giin && + chapter3_entity_type == o.chapter3_entity_type && + chapter4_fatca_status == o.chapter4_fatca_status && + disregarded_entity == o.disregarded_entity && + disregarded_entity_giin == o.disregarded_entity_giin && + benefit_limitation == o.benefit_limitation && + part4_sponsoring_entity == o.part4_sponsoring_entity && + part4_sponsoring_entity_giin == o.part4_sponsoring_entity_giin && + part7_sponsoring_entity == o.part7_sponsoring_entity && + part12_iga_country == o.part12_iga_country && + part12_iga_type == o.part12_iga_type && + part12_fatca_status_under_iga_annex_ii == o.part12_fatca_status_under_iga_annex_ii && + part12_trustee_name == o.part12_trustee_name && + part12_trustee_is_foreign == o.part12_trustee_is_foreign && + part12_model2_iga_giin == o.part12_model2_iga_giin && + box37_a_exchange == o.box37_a_exchange && + box37_b_exchange == o.box37_b_exchange && + box37_b_entity == o.box37_b_entity && + part28_sponsoring_entity == o.part28_sponsoring_entity && + part28_sponsoring_entity_giin == o.part28_sponsoring_entity_giin && + signer_name == o.signer_name && + e_delivery_consented_at == o.e_delivery_consented_at && + residence_is_mailing == o.residence_is_mailing && + citizenship_country == o.citizenship_country && + making_treaty_claim == o.making_treaty_claim && + treaty_country == o.treaty_country && + treaty_article == o.treaty_article && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + treaty_reasons == o.treaty_reasons && + certify_box14_a == o.certify_box14_a && + certify_box14_b == o.certify_box14_b && + certify_box14_c == o.certify_box14_c && + certify_box17_1 == o.certify_box17_1 && + certify_box17_2 == o.certify_box17_2 && + certify_box18 == o.certify_box18 && + certify_box19 == o.certify_box19 && + certify_box21 == o.certify_box21 && + certify_box22 == o.certify_box22 && + certify_box23 == o.certify_box23 && + certify_box24_a == o.certify_box24_a && + certify_box24_b == o.certify_box24_b && + certify_box24_c == o.certify_box24_c && + certify_box24_d == o.certify_box24_d && + certify_box25_a == o.certify_box25_a && + certify_box25_b == o.certify_box25_b && + certify_box25_c == o.certify_box25_c && + certify_box26 == o.certify_box26 && + certify_box27 == o.certify_box27 && + certify_box28_a == o.certify_box28_a && + certify_box28_b == o.certify_box28_b && + certify_box29_a == o.certify_box29_a && + certify_box29_b == o.certify_box29_b && + certify_box29_c == o.certify_box29_c && + certify_box29_d == o.certify_box29_d && + certify_box29_e == o.certify_box29_e && + certify_box29_f == o.certify_box29_f && + certify_box30 == o.certify_box30 && + certify_box31 == o.certify_box31 && + certify_box32 == o.certify_box32 && + certify_box33 == o.certify_box33 && + certify_box34 == o.certify_box34 && + certify_box35 == o.certify_box35 && + certify_box36 == o.certify_box36 && + certify_box37_a == o.certify_box37_a && + certify_box37_b == o.certify_box37_b && + certify_box38 == o.certify_box38 && + certify_box39 == o.certify_box39 && + certify_box40_a == o.certify_box40_a && + certify_box40_b == o.certify_box40_b && + certify_box40_c == o.certify_box40_c && + certify_box41 == o.certify_box41 && + certify_box43 == o.certify_box43 && + certify_part29_signature == o.certify_part29_signature && + part19_formation_or_resolution_date == o.part19_formation_or_resolution_date && + part20_filing_date == o.part20_filing_date && + part21_determination_date == o.part21_determination_date && + substantial_us_owners == o.substantial_us_owners && + 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 && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + box3_marital_status == o.box3_marital_status && + box4_last_name_differs == o.box4_last_name_differs && + box5_num_allowances == o.box5_num_allowances && + other_dependents == o.other_dependents && + non_job_income == o.non_job_income && + deductions == o.deductions && + box6_additional_withheld == o.box6_additional_withheld && + box7_exempt_from_withholding == o.box7_exempt_from_withholding && + office_code == o.office_code && + birthday == o.birthday && + foreign_tin_not_required == o.foreign_tin_not_required && + archived == o.archived && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + signer_capacity == o.signer_capacity && + updated_at == o.updated_at && + ein == o.ein && + ein_type == o.ein_type && + certify_box14 == o.certify_box14 && + certify_box15_a == o.certify_box15_a && + certify_box15_b == o.certify_box15_b && + certify_box15_c == o.certify_box15_c && + certify_box15_d == o.certify_box15_d && + certify_box15_e == o.certify_box15_e && + certify_box15_f == o.certify_box15_f && + certify_box15_g == o.certify_box15_g && + certify_box15_h == o.certify_box15_h && + certify_box15_i == o.certify_box15_i && + certify_box16_a == o.certify_box16_a && + box16_b_qdd_corporate == o.box16_b_qdd_corporate && + box16_b_qdd_partnership == o.box16_b_qdd_partnership && + box16_b_qdd_disregarded_entity == o.box16_b_qdd_disregarded_entity && + certify_box17_a == o.certify_box17_a && + certify_box17_b == o.certify_box17_b && + certify_box17_c == o.certify_box17_c && + certify_box17_d == o.certify_box17_d && + certify_box17_e == o.certify_box17_e && + certify_box18_a == o.certify_box18_a && + certify_box18_b == o.certify_box18_b && + certify_box18_c == o.certify_box18_c && + certify_box18_d == o.certify_box18_d && + certify_box18_e == o.certify_box18_e && + certify_box18_f == o.certify_box18_f && + certify_box19_a == o.certify_box19_a && + certify_box19_b == o.certify_box19_b && + certify_box19_c == o.certify_box19_c && + certify_box19_d == o.certify_box19_d && + certify_box19_e == o.certify_box19_e && + certify_box19_f == o.certify_box19_f && + certify_box20 == o.certify_box20 && + certify_box21_a == o.certify_box21_a && + certify_box21_b == o.certify_box21_b && + certify_box21_c == o.certify_box21_c && + certify_box21_d == o.certify_box21_d && + certify_box21_e == o.certify_box21_e && + certify_box21_f == o.certify_box21_f && + box23_a_name_sponsoring_entity == o.box23_a_name_sponsoring_entity && + certify_box23_b == o.certify_box23_b && + certify_box23_c == o.certify_box23_c && + certify_box25 == o.certify_box25 && + box27_a_name_sponsoring_entity == o.box27_a_name_sponsoring_entity && + certify_box27_b == o.certify_box27_b && + certify_box28 == o.certify_box28 && + certify_box29 == o.certify_box29 && + certify_box30_a == o.certify_box30_a && + certify_box30_b == o.certify_box30_b && + certify_box30_c == o.certify_box30_c && + box32_iga_country == o.box32_iga_country && + box32_iga_type == o.box32_iga_type && + box32_iga_treated_as == o.box32_iga_treated_as && + box32_trustee_or_sponsor == o.box32_trustee_or_sponsor && + box32_trustee_is_foreign == o.box32_trustee_is_foreign && + certify_box33_a == o.certify_box33_a && + certify_box33_b == o.certify_box33_b && + certify_box33_c == o.certify_box33_c && + certify_box33_d == o.certify_box33_d && + certify_box33_e == o.certify_box33_e && + certify_box33_f == o.certify_box33_f && + box37_a_securities_market == o.box37_a_securities_market && + box37_b_name_of_entity == o.box37_b_name_of_entity && + box37_b_securities_market == o.box37_b_securities_market && + certify_box40 == o.certify_box40 && + box41_sponsoring_entity == o.box41_sponsoring_entity && + certify_box42 == o.certify_box42 && + box35_formed_on_date == o.box35_formed_on_date && + box36_filed_on_date == o.box36_filed_on_date && + tin_match_status == o.tin_match_status && + signature == o.signature && + business_classification == o.business_classification && + business_name == o.business_name && + business_other == o.business_other && + exempt_payee_code == o.exempt_payee_code && + exempt_fatca_code == o.exempt_fatca_code && + account_number == o.account_number && + foreign_country_indicator == o.foreign_country_indicator && + foreign_address == o.foreign_address && + backup_withholding == o.backup_withholding && + is1099able == o.is1099able && + foreign_partner_owner_or_beneficiary == o.foreign_partner_owner_or_beneficiary + 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, signed_date, disregarded_entity_chapter4_fatca_status, created_at, name, residence_address, residence_city, residence_state, residence_postal_code, residence_country, mailing_address, mailing_city, mailing_state, mailing_postal_code, mailing_country, disregarded_address, disregarded_city, disregarded_state, disregarded_postal_code, disregarded_country, tin, type_of_tin, foreign_tin, ftin_not_required, reference_number, giin, chapter3_entity_type, chapter4_fatca_status, disregarded_entity, disregarded_entity_giin, benefit_limitation, part4_sponsoring_entity, part4_sponsoring_entity_giin, part7_sponsoring_entity, part12_iga_country, part12_iga_type, part12_fatca_status_under_iga_annex_ii, part12_trustee_name, part12_trustee_is_foreign, part12_model2_iga_giin, box37_a_exchange, box37_b_exchange, box37_b_entity, part28_sponsoring_entity, part28_sponsoring_entity_giin, signer_name, e_delivery_consented_at, residence_is_mailing, citizenship_country, making_treaty_claim, treaty_country, treaty_article, withholding_rate, income_type, treaty_reasons, certify_box14_a, certify_box14_b, certify_box14_c, certify_box17_1, certify_box17_2, certify_box18, certify_box19, certify_box21, certify_box22, certify_box23, certify_box24_a, certify_box24_b, certify_box24_c, certify_box24_d, certify_box25_a, certify_box25_b, certify_box25_c, certify_box26, certify_box27, certify_box28_a, certify_box28_b, certify_box29_a, certify_box29_b, certify_box29_c, certify_box29_d, certify_box29_e, certify_box29_f, certify_box30, certify_box31, certify_box32, certify_box33, certify_box34, certify_box35, certify_box36, certify_box37_a, certify_box37_b, certify_box38, certify_box39, certify_box40_a, certify_box40_b, certify_box40_c, certify_box41, certify_box43, certify_part29_signature, part19_formation_or_resolution_date, part20_filing_date, part21_determination_date, substantial_us_owners, employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, address, city, state, zip, box3_marital_status, box4_last_name_differs, box5_num_allowances, other_dependents, non_job_income, deductions, box6_additional_withheld, box7_exempt_from_withholding, office_code, birthday, foreign_tin_not_required, archived, reference_id, company_id, display_name, email, signer_capacity, updated_at, ein, ein_type, certify_box14, certify_box15_a, certify_box15_b, certify_box15_c, certify_box15_d, certify_box15_e, certify_box15_f, certify_box15_g, certify_box15_h, certify_box15_i, certify_box16_a, box16_b_qdd_corporate, box16_b_qdd_partnership, box16_b_qdd_disregarded_entity, certify_box17_a, certify_box17_b, certify_box17_c, certify_box17_d, certify_box17_e, certify_box18_a, certify_box18_b, certify_box18_c, certify_box18_d, certify_box18_e, certify_box18_f, certify_box19_a, certify_box19_b, certify_box19_c, certify_box19_d, certify_box19_e, certify_box19_f, certify_box20, certify_box21_a, certify_box21_b, certify_box21_c, certify_box21_d, certify_box21_e, certify_box21_f, box23_a_name_sponsoring_entity, certify_box23_b, certify_box23_c, certify_box25, box27_a_name_sponsoring_entity, certify_box27_b, certify_box28, certify_box29, certify_box30_a, certify_box30_b, certify_box30_c, box32_iga_country, box32_iga_type, box32_iga_treated_as, box32_trustee_or_sponsor, box32_trustee_is_foreign, certify_box33_a, certify_box33_b, certify_box33_c, certify_box33_d, certify_box33_e, certify_box33_f, box37_a_securities_market, box37_b_name_of_entity, box37_b_securities_market, certify_box40, box41_sponsoring_entity, certify_box42, box35_formed_on_date, box36_filed_on_date, tin_match_status, signature, business_classification, business_name, business_other, exempt_payee_code, exempt_fatca_code, account_number, foreign_country_indicator, foreign_address, backup_withholding, is1099able, foreign_partner_owner_or_beneficiary].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_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb new file mode 100644 index 0000000..3acd8ce --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb @@ -0,0 +1,2443 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + # W-8 IMY form + class W8ImyFormDataModel + # Type of the form, always W8IMY for this model. + attr_accessor :type + + # The date the form was signed. + attr_accessor :signed_date + + # The FATCA status for disregarded entities under Chapter 4. + attr_accessor :disregarded_entity_chapter4_fatca_status + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # The taxpayer identification number (TIN) of the employee. + attr_accessor :tin + + # The type of TIN provided. + attr_accessor :type_of_tin + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # The country of citizenship. + attr_accessor :citizenship_country + + # The Chapter 3 entity type. + attr_accessor :chapter3_entity_type + + # The Chapter 4 FATCA status. + attr_accessor :chapter4_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 postal code of the residence. + attr_accessor :residence_postal_code + + # 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 postal code of the mailing address. + attr_accessor :mailing_postal_code + + # The country of the mailing address. + attr_accessor :mailing_country + + # The disregarded entity information. + attr_accessor :disregarded_entity + + # 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 postal code for disregarded entities. + attr_accessor :disregarded_postal_code + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # The employer identification number (EIN). + attr_accessor :ein + + # The type of employer identification number (EIN). + attr_accessor :ein_type + + # 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 + + # Indicates certification for box 14. + attr_accessor :certify_box14 + + # Indicates certification for box 15A. + attr_accessor :certify_box15_a + + # Indicates certification for box 15B. + attr_accessor :certify_box15_b + + # Indicates certification for box 15C. + attr_accessor :certify_box15_c + + # Indicates certification for box 15D. + attr_accessor :certify_box15_d + + # Indicates certification for box 15E. + attr_accessor :certify_box15_e + + # Indicates certification for box 15F. + attr_accessor :certify_box15_f + + # Indicates certification for box 15G. + attr_accessor :certify_box15_g + + # Indicates certification for box 15H. + attr_accessor :certify_box15_h + + # Indicates certification for box 15I. + attr_accessor :certify_box15_i + + # Indicates certification for box 16A. + attr_accessor :certify_box16_a + + # Indicates certification for box 16B as a QDD corporate entity. + attr_accessor :box16_b_qdd_corporate + + # Indicates certification for box 16B as a QDD partnership. + attr_accessor :box16_b_qdd_partnership + + # Indicates certification for box 16B as a QDD disregarded entity. + attr_accessor :box16_b_qdd_disregarded_entity + + # Indicates certification for box 17A. + attr_accessor :certify_box17_a + + # Indicates certification for box 17B. + attr_accessor :certify_box17_b + + # Indicates certification for box 17C. + attr_accessor :certify_box17_c + + # Indicates certification for box 17D. + attr_accessor :certify_box17_d + + # Indicates certification for box 17E. + attr_accessor :certify_box17_e + + # Indicates certification for box 18A. + attr_accessor :certify_box18_a + + # Indicates certification for box 18B. + attr_accessor :certify_box18_b + + # Indicates certification for box 18C. + attr_accessor :certify_box18_c + + # Indicates certification for box 18D. + attr_accessor :certify_box18_d + + # Indicates certification for box 18E. + attr_accessor :certify_box18_e + + # Indicates certification for box 18F. + attr_accessor :certify_box18_f + + # Indicates certification for box 19A. + attr_accessor :certify_box19_a + + # Indicates certification for box 19B. + attr_accessor :certify_box19_b + + # Indicates certification for box 19C. + attr_accessor :certify_box19_c + + # Indicates certification for box 19D. + attr_accessor :certify_box19_d + + # Indicates certification for box 19E. + attr_accessor :certify_box19_e + + # Indicates certification for box 19F. + attr_accessor :certify_box19_f + + # Indicates certification for box 20. + attr_accessor :certify_box20 + + # Indicates certification for box 21A. + attr_accessor :certify_box21_a + + # Indicates certification for box 21B. + attr_accessor :certify_box21_b + + # Indicates certification for box 21C. + attr_accessor :certify_box21_c + + # Indicates certification for box 21D. + attr_accessor :certify_box21_d + + # Indicates certification for box 21E. + attr_accessor :certify_box21_e + + # Indicates certification for box 21F. + attr_accessor :certify_box21_f + + # Indicates certification for box 22. + attr_accessor :certify_box22 + + # The name of the sponsoring entity for box 23A. + attr_accessor :box23_a_name_sponsoring_entity + + # Indicates certification for box 23B. + attr_accessor :certify_box23_b + + # Indicates certification for box 23C. + attr_accessor :certify_box23_c + + # Indicates certification for box 24A. + attr_accessor :certify_box24_a + + # Indicates certification for box 24B. + attr_accessor :certify_box24_b + + # Indicates certification for box 24C. + attr_accessor :certify_box24_c + + # Indicates certification for box 25. + attr_accessor :certify_box25 + + # Indicates certification for box 26. + attr_accessor :certify_box26 + + # The name of the sponsoring entity for box 27A. + attr_accessor :box27_a_name_sponsoring_entity + + # Indicates certification for box 27B. + attr_accessor :certify_box27_b + + # Indicates certification for box 28. + attr_accessor :certify_box28 + + # Indicates certification for box 29. + attr_accessor :certify_box29 + + # Indicates certification for box 30A. + attr_accessor :certify_box30_a + + # Indicates certification for box 30B. + attr_accessor :certify_box30_b + + # Indicates certification for box 30C. + attr_accessor :certify_box30_c + + # Indicates certification for box 31. + attr_accessor :certify_box31 + + # Indicates certification for box 32. + attr_accessor :certify_box32 + + # The IGA country information for box 32. + attr_accessor :box32_iga_country + + # The IGA type information for box 32. + attr_accessor :box32_iga_type + + # The IGA treatment information for box 32. + attr_accessor :box32_iga_treated_as + + # The trustee or sponsor information for box 32. + attr_accessor :box32_trustee_or_sponsor + + # Indicates whether the trustee is foreign for box 32. + attr_accessor :box32_trustee_is_foreign + + # Indicates certification for box 33A. + attr_accessor :certify_box33_a + + # Indicates certification for box 33B. + attr_accessor :certify_box33_b + + # Indicates certification for box 33C. + attr_accessor :certify_box33_c + + # Indicates certification for box 33D. + attr_accessor :certify_box33_d + + # Indicates certification for box 33E. + attr_accessor :certify_box33_e + + # Indicates certification for box 33F. + attr_accessor :certify_box33_f + + # Indicates certification for box 34. + attr_accessor :certify_box34 + + # Indicates certification for box 35. + attr_accessor :certify_box35 + + # Indicates certification for box 36. + attr_accessor :certify_box36 + + # Indicates certification for box 37A. + attr_accessor :certify_box37_a + + # The securities market information for box 37A. + attr_accessor :box37_a_securities_market + + # Indicates certification for box 37B. + attr_accessor :certify_box37_b + + # The name of the entity for box 37B. + attr_accessor :box37_b_name_of_entity + + # The securities market information for box 37B. + attr_accessor :box37_b_securities_market + + # Indicates certification for box 38. + attr_accessor :certify_box38 + + # Indicates certification for box 39. + attr_accessor :certify_box39 + + # Indicates certification for box 40. + attr_accessor :certify_box40 + + # The sponsoring entity information for box 41. + attr_accessor :box41_sponsoring_entity + + # Indicates certification for box 42. + attr_accessor :certify_box42 + + # The name of the signer of the form. + attr_accessor :signer_name + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + attr_accessor :box35_formed_on_date + + attr_accessor :box36_filed_on_date + + # 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 address of the individual or entity. + attr_accessor :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 marital status of the employee. + attr_accessor :box3_marital_status + + # Indicates whether the last name differs from prior records. + attr_accessor :box4_last_name_differs + + # The number of allowances claimed by the employee. + attr_accessor :box5_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 :box6_additional_withheld + + # Indicates whether the employee is exempt from withholding. + attr_accessor :box7_exempt_from_withholding + + # The office code associated with the form. + attr_accessor :office_code + + # Indicates whether a foreign TIN is not required. + attr_accessor :ftin_not_required + + # The benefit limitation for tax treaty claims. + attr_accessor :benefit_limitation + + # The sponsoring entity information for Part 4. + attr_accessor :part4_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 4. + attr_accessor :part4_sponsoring_entity_giin + + # The sponsoring entity information for Part 7. + attr_accessor :part7_sponsoring_entity + + # The IGA country information for Part 12. + attr_accessor :part12_iga_country + + # The IGA type information for Part 12. + attr_accessor :part12_iga_type + + # The FATCA status under IGA Annex II for Part 12. + attr_accessor :part12_fatca_status_under_iga_annex_ii + + # The trustee name for Part 12. + attr_accessor :part12_trustee_name + + # Indicates whether the trustee is foreign for Part 12. + attr_accessor :part12_trustee_is_foreign + + # The GIIN for Model 2 IGA in Part 12. + attr_accessor :part12_model2_iga_giin + + # The exchange information for Box 37A. + attr_accessor :box37_a_exchange + + # The exchange information for Box 37B. + attr_accessor :box37_b_exchange + + # The entity information for Box 37B. + attr_accessor :box37_b_entity + + # The sponsoring entity information for Part 28. + attr_accessor :part28_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 28. + attr_accessor :part28_sponsoring_entity_giin + + attr_accessor :making_treaty_claim + + # The country for which the treaty applies. + attr_accessor :treaty_country + + # The specific article of the treaty being claimed. + attr_accessor :treaty_article + + # 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 reasons for claiming treaty benefits. + attr_accessor :treaty_reasons + + attr_accessor :certify_box14_a + + attr_accessor :certify_box14_b + + attr_accessor :certify_box14_c + + attr_accessor :certify_box17_1 + + attr_accessor :certify_box17_2 + + attr_accessor :certify_box18 + + attr_accessor :certify_box19 + + attr_accessor :certify_box21 + + attr_accessor :certify_box23 + + attr_accessor :certify_box24_d + + attr_accessor :certify_box25_a + + attr_accessor :certify_box25_b + + attr_accessor :certify_box25_c + + attr_accessor :certify_box27 + + attr_accessor :certify_box28_a + + attr_accessor :certify_box28_b + + attr_accessor :certify_box29_a + + attr_accessor :certify_box29_b + + attr_accessor :certify_box29_c + + attr_accessor :certify_box29_d + + attr_accessor :certify_box29_e + + attr_accessor :certify_box29_f + + attr_accessor :certify_box30 + + attr_accessor :certify_box33 + + attr_accessor :certify_box40_a + + attr_accessor :certify_box40_b + + attr_accessor :certify_box40_c + + attr_accessor :certify_box41 + + attr_accessor :certify_box43 + + attr_accessor :certify_part29_signature + + attr_accessor :part19_formation_or_resolution_date + + attr_accessor :part20_filing_date + + attr_accessor :part21_determination_date + + attr_accessor :substantial_us_owners + + # The birthday of the individual associated with the form. + attr_accessor :birthday + + # Indicates whether a foreign TIN is not required. + attr_accessor :foreign_tin_not_required + + # Indicates whether the form is archived. + attr_accessor :archived + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The capacity in which the signer is signing the form. + attr_accessor :signer_capacity + + # The status of the TIN match. + attr_accessor :tin_match_status + + # The signature itself + attr_accessor :signature + + # The classification of the business. + attr_accessor :business_classification + + # The name of the business associated with the form. + attr_accessor :business_name + + attr_accessor :business_other + + attr_accessor :exempt_payee_code + + attr_accessor :exempt_fatca_code + + # The account number associated with the form. + attr_accessor :account_number + + # Indicates whether the individual or entity is in a foreign country. + attr_accessor :foreign_country_indicator + + # The foreign address of the individual or entity. + attr_accessor :foreign_address + + # Indicates whether backup withholding applies. + attr_accessor :backup_withholding + + attr_accessor :is1099able + + # Indicates whether the individual is a foreign partner, owner, or beneficiary. + attr_accessor :foreign_partner_owner_or_beneficiary + + 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', + :'signed_date' => :'signedDate', + :'disregarded_entity_chapter4_fatca_status' => :'disregardedEntityChapter4FatcaStatus', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'display_name' => :'displayName', + :'email' => :'email', + :'tin' => :'tin', + :'type_of_tin' => :'typeOfTin', + :'name' => :'name', + :'citizenship_country' => :'citizenshipCountry', + :'chapter3_entity_type' => :'chapter3EntityType', + :'chapter4_fatca_status' => :'chapter4FatcaStatus', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_postal_code' => :'residencePostalCode', + :'residence_country' => :'residenceCountry', + :'residence_is_mailing' => :'residenceIsMailing', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_postal_code' => :'mailingPostalCode', + :'mailing_country' => :'mailingCountry', + :'disregarded_entity' => :'disregardedEntity', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_postal_code' => :'disregardedPostalCode', + :'disregarded_country' => :'disregardedCountry', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'ein' => :'ein', + :'ein_type' => :'einType', + :'giin' => :'giin', + :'foreign_tin' => :'foreignTin', + :'reference_number' => :'referenceNumber', + :'certify_box14' => :'certifyBox14', + :'certify_box15_a' => :'certifyBox15A', + :'certify_box15_b' => :'certifyBox15B', + :'certify_box15_c' => :'certifyBox15C', + :'certify_box15_d' => :'certifyBox15D', + :'certify_box15_e' => :'certifyBox15E', + :'certify_box15_f' => :'certifyBox15F', + :'certify_box15_g' => :'certifyBox15G', + :'certify_box15_h' => :'certifyBox15H', + :'certify_box15_i' => :'certifyBox15I', + :'certify_box16_a' => :'certifyBox16A', + :'box16_b_qdd_corporate' => :'box16BQddCorporate', + :'box16_b_qdd_partnership' => :'box16BQddPartnership', + :'box16_b_qdd_disregarded_entity' => :'box16BQddDisregardedEntity', + :'certify_box17_a' => :'certifyBox17A', + :'certify_box17_b' => :'certifyBox17B', + :'certify_box17_c' => :'certifyBox17C', + :'certify_box17_d' => :'certifyBox17D', + :'certify_box17_e' => :'certifyBox17E', + :'certify_box18_a' => :'certifyBox18A', + :'certify_box18_b' => :'certifyBox18B', + :'certify_box18_c' => :'certifyBox18C', + :'certify_box18_d' => :'certifyBox18D', + :'certify_box18_e' => :'certifyBox18E', + :'certify_box18_f' => :'certifyBox18F', + :'certify_box19_a' => :'certifyBox19A', + :'certify_box19_b' => :'certifyBox19B', + :'certify_box19_c' => :'certifyBox19C', + :'certify_box19_d' => :'certifyBox19D', + :'certify_box19_e' => :'certifyBox19E', + :'certify_box19_f' => :'certifyBox19F', + :'certify_box20' => :'certifyBox20', + :'certify_box21_a' => :'certifyBox21A', + :'certify_box21_b' => :'certifyBox21B', + :'certify_box21_c' => :'certifyBox21C', + :'certify_box21_d' => :'certifyBox21D', + :'certify_box21_e' => :'certifyBox21E', + :'certify_box21_f' => :'certifyBox21F', + :'certify_box22' => :'certifyBox22', + :'box23_a_name_sponsoring_entity' => :'box23ANameSponsoringEntity', + :'certify_box23_b' => :'certifyBox23B', + :'certify_box23_c' => :'certifyBox23C', + :'certify_box24_a' => :'certifyBox24A', + :'certify_box24_b' => :'certifyBox24B', + :'certify_box24_c' => :'certifyBox24C', + :'certify_box25' => :'certifyBox25', + :'certify_box26' => :'certifyBox26', + :'box27_a_name_sponsoring_entity' => :'box27ANameSponsoringEntity', + :'certify_box27_b' => :'certifyBox27B', + :'certify_box28' => :'certifyBox28', + :'certify_box29' => :'certifyBox29', + :'certify_box30_a' => :'certifyBox30A', + :'certify_box30_b' => :'certifyBox30B', + :'certify_box30_c' => :'certifyBox30C', + :'certify_box31' => :'certifyBox31', + :'certify_box32' => :'certifyBox32', + :'box32_iga_country' => :'box32IgaCountry', + :'box32_iga_type' => :'box32IgaType', + :'box32_iga_treated_as' => :'box32IgaTreatedAs', + :'box32_trustee_or_sponsor' => :'box32TrusteeOrSponsor', + :'box32_trustee_is_foreign' => :'box32TrusteeIsForeign', + :'certify_box33_a' => :'certifyBox33A', + :'certify_box33_b' => :'certifyBox33B', + :'certify_box33_c' => :'certifyBox33C', + :'certify_box33_d' => :'certifyBox33D', + :'certify_box33_e' => :'certifyBox33E', + :'certify_box33_f' => :'certifyBox33F', + :'certify_box34' => :'certifyBox34', + :'certify_box35' => :'certifyBox35', + :'certify_box36' => :'certifyBox36', + :'certify_box37_a' => :'certifyBox37A', + :'box37_a_securities_market' => :'box37ASecuritiesMarket', + :'certify_box37_b' => :'certifyBox37B', + :'box37_b_name_of_entity' => :'box37BNameOfEntity', + :'box37_b_securities_market' => :'box37BSecuritiesMarket', + :'certify_box38' => :'certifyBox38', + :'certify_box39' => :'certifyBox39', + :'certify_box40' => :'certifyBox40', + :'box41_sponsoring_entity' => :'box41SponsoringEntity', + :'certify_box42' => :'certifyBox42', + :'signer_name' => :'signerName', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'box35_formed_on_date' => :'box35FormedOnDate', + :'box36_filed_on_date' => :'box36FiledOnDate', + :'employee_first_name' => :'employeeFirstName', + :'employee_middle_name' => :'employeeMiddleName', + :'employee_last_name' => :'employeeLastName', + :'employee_name_suffix' => :'employeeNameSuffix', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'box3_marital_status' => :'box3MaritalStatus', + :'box4_last_name_differs' => :'box4LastNameDiffers', + :'box5_num_allowances' => :'box5NumAllowances', + :'other_dependents' => :'otherDependents', + :'non_job_income' => :'nonJobIncome', + :'deductions' => :'deductions', + :'box6_additional_withheld' => :'box6AdditionalWithheld', + :'box7_exempt_from_withholding' => :'box7ExemptFromWithholding', + :'office_code' => :'officeCode', + :'ftin_not_required' => :'ftinNotRequired', + :'benefit_limitation' => :'benefitLimitation', + :'part4_sponsoring_entity' => :'part4SponsoringEntity', + :'part4_sponsoring_entity_giin' => :'part4SponsoringEntityGiin', + :'part7_sponsoring_entity' => :'part7SponsoringEntity', + :'part12_iga_country' => :'part12IgaCountry', + :'part12_iga_type' => :'part12IgaType', + :'part12_fatca_status_under_iga_annex_ii' => :'part12FatcaStatusUnderIgaAnnexIi', + :'part12_trustee_name' => :'part12TrusteeName', + :'part12_trustee_is_foreign' => :'part12TrusteeIsForeign', + :'part12_model2_iga_giin' => :'part12Model2IgaGiin', + :'box37_a_exchange' => :'box37AExchange', + :'box37_b_exchange' => :'box37BExchange', + :'box37_b_entity' => :'box37BEntity', + :'part28_sponsoring_entity' => :'part28SponsoringEntity', + :'part28_sponsoring_entity_giin' => :'part28SponsoringEntityGiin', + :'making_treaty_claim' => :'makingTreatyClaim', + :'treaty_country' => :'treatyCountry', + :'treaty_article' => :'treatyArticle', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'treaty_reasons' => :'treatyReasons', + :'certify_box14_a' => :'certifyBox14A', + :'certify_box14_b' => :'certifyBox14B', + :'certify_box14_c' => :'certifyBox14C', + :'certify_box17_1' => :'certifyBox17_1', + :'certify_box17_2' => :'certifyBox17_2', + :'certify_box18' => :'certifyBox18', + :'certify_box19' => :'certifyBox19', + :'certify_box21' => :'certifyBox21', + :'certify_box23' => :'certifyBox23', + :'certify_box24_d' => :'certifyBox24D', + :'certify_box25_a' => :'certifyBox25A', + :'certify_box25_b' => :'certifyBox25B', + :'certify_box25_c' => :'certifyBox25C', + :'certify_box27' => :'certifyBox27', + :'certify_box28_a' => :'certifyBox28A', + :'certify_box28_b' => :'certifyBox28B', + :'certify_box29_a' => :'certifyBox29A', + :'certify_box29_b' => :'certifyBox29B', + :'certify_box29_c' => :'certifyBox29C', + :'certify_box29_d' => :'certifyBox29D', + :'certify_box29_e' => :'certifyBox29E', + :'certify_box29_f' => :'certifyBox29F', + :'certify_box30' => :'certifyBox30', + :'certify_box33' => :'certifyBox33', + :'certify_box40_a' => :'certifyBox40A', + :'certify_box40_b' => :'certifyBox40B', + :'certify_box40_c' => :'certifyBox40C', + :'certify_box41' => :'certifyBox41', + :'certify_box43' => :'certifyBox43', + :'certify_part29_signature' => :'certifyPart29Signature', + :'part19_formation_or_resolution_date' => :'part19FormationOrResolutionDate', + :'part20_filing_date' => :'part20FilingDate', + :'part21_determination_date' => :'part21DeterminationDate', + :'substantial_us_owners' => :'substantialUsOwners', + :'birthday' => :'birthday', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'archived' => :'archived', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'signer_capacity' => :'signerCapacity', + :'tin_match_status' => :'tinMatchStatus', + :'signature' => :'signature', + :'business_classification' => :'businessClassification', + :'business_name' => :'businessName', + :'business_other' => :'businessOther', + :'exempt_payee_code' => :'exemptPayeeCode', + :'exempt_fatca_code' => :'exemptFatcaCode', + :'account_number' => :'accountNumber', + :'foreign_country_indicator' => :'foreignCountryIndicator', + :'foreign_address' => :'foreignAddress', + :'backup_withholding' => :'backupWithholding', + :'is1099able' => :'is1099able', + :'foreign_partner_owner_or_beneficiary' => :'foreignPartnerOwnerOrBeneficiary' + } + 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', + :'signed_date' => :'Time', + :'disregarded_entity_chapter4_fatca_status' => :'String', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'display_name' => :'String', + :'email' => :'String', + :'tin' => :'String', + :'type_of_tin' => :'String', + :'name' => :'String', + :'citizenship_country' => :'String', + :'chapter3_entity_type' => :'String', + :'chapter4_fatca_status' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_postal_code' => :'String', + :'residence_country' => :'String', + :'residence_is_mailing' => :'Boolean', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_postal_code' => :'String', + :'mailing_country' => :'String', + :'disregarded_entity' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_postal_code' => :'String', + :'disregarded_country' => :'String', + :'disregarded_entity_giin' => :'String', + :'ein' => :'String', + :'ein_type' => :'String', + :'giin' => :'String', + :'foreign_tin' => :'String', + :'reference_number' => :'String', + :'certify_box14' => :'Boolean', + :'certify_box15_a' => :'Boolean', + :'certify_box15_b' => :'Boolean', + :'certify_box15_c' => :'Boolean', + :'certify_box15_d' => :'Boolean', + :'certify_box15_e' => :'Boolean', + :'certify_box15_f' => :'Boolean', + :'certify_box15_g' => :'Boolean', + :'certify_box15_h' => :'Boolean', + :'certify_box15_i' => :'Boolean', + :'certify_box16_a' => :'Boolean', + :'box16_b_qdd_corporate' => :'Boolean', + :'box16_b_qdd_partnership' => :'Boolean', + :'box16_b_qdd_disregarded_entity' => :'Boolean', + :'certify_box17_a' => :'Boolean', + :'certify_box17_b' => :'Boolean', + :'certify_box17_c' => :'Boolean', + :'certify_box17_d' => :'Boolean', + :'certify_box17_e' => :'Boolean', + :'certify_box18_a' => :'Boolean', + :'certify_box18_b' => :'Boolean', + :'certify_box18_c' => :'Boolean', + :'certify_box18_d' => :'Boolean', + :'certify_box18_e' => :'Boolean', + :'certify_box18_f' => :'Boolean', + :'certify_box19_a' => :'Boolean', + :'certify_box19_b' => :'Boolean', + :'certify_box19_c' => :'Boolean', + :'certify_box19_d' => :'Boolean', + :'certify_box19_e' => :'Boolean', + :'certify_box19_f' => :'Boolean', + :'certify_box20' => :'Boolean', + :'certify_box21_a' => :'Boolean', + :'certify_box21_b' => :'Boolean', + :'certify_box21_c' => :'Boolean', + :'certify_box21_d' => :'Boolean', + :'certify_box21_e' => :'Boolean', + :'certify_box21_f' => :'Boolean', + :'certify_box22' => :'Boolean', + :'box23_a_name_sponsoring_entity' => :'String', + :'certify_box23_b' => :'Boolean', + :'certify_box23_c' => :'Boolean', + :'certify_box24_a' => :'Boolean', + :'certify_box24_b' => :'Boolean', + :'certify_box24_c' => :'Boolean', + :'certify_box25' => :'Boolean', + :'certify_box26' => :'Boolean', + :'box27_a_name_sponsoring_entity' => :'String', + :'certify_box27_b' => :'Boolean', + :'certify_box28' => :'Boolean', + :'certify_box29' => :'Boolean', + :'certify_box30_a' => :'Boolean', + :'certify_box30_b' => :'Boolean', + :'certify_box30_c' => :'Boolean', + :'certify_box31' => :'Boolean', + :'certify_box32' => :'Boolean', + :'box32_iga_country' => :'String', + :'box32_iga_type' => :'String', + :'box32_iga_treated_as' => :'String', + :'box32_trustee_or_sponsor' => :'String', + :'box32_trustee_is_foreign' => :'Boolean', + :'certify_box33_a' => :'Boolean', + :'certify_box33_b' => :'Boolean', + :'certify_box33_c' => :'Boolean', + :'certify_box33_d' => :'Boolean', + :'certify_box33_e' => :'Boolean', + :'certify_box33_f' => :'Boolean', + :'certify_box34' => :'Boolean', + :'certify_box35' => :'Boolean', + :'certify_box36' => :'Boolean', + :'certify_box37_a' => :'Boolean', + :'box37_a_securities_market' => :'String', + :'certify_box37_b' => :'Boolean', + :'box37_b_name_of_entity' => :'String', + :'box37_b_securities_market' => :'String', + :'certify_box38' => :'Boolean', + :'certify_box39' => :'Boolean', + :'certify_box40' => :'Boolean', + :'box41_sponsoring_entity' => :'String', + :'certify_box42' => :'Boolean', + :'signer_name' => :'String', + :'e_delivery_consented_at' => :'Time', + :'box35_formed_on_date' => :'Time', + :'box36_filed_on_date' => :'Time', + :'employee_first_name' => :'String', + :'employee_middle_name' => :'String', + :'employee_last_name' => :'String', + :'employee_name_suffix' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'box3_marital_status' => :'String', + :'box4_last_name_differs' => :'Boolean', + :'box5_num_allowances' => :'Integer', + :'other_dependents' => :'Integer', + :'non_job_income' => :'Float', + :'deductions' => :'Float', + :'box6_additional_withheld' => :'Float', + :'box7_exempt_from_withholding' => :'Boolean', + :'office_code' => :'String', + :'ftin_not_required' => :'Boolean', + :'benefit_limitation' => :'String', + :'part4_sponsoring_entity' => :'String', + :'part4_sponsoring_entity_giin' => :'String', + :'part7_sponsoring_entity' => :'String', + :'part12_iga_country' => :'String', + :'part12_iga_type' => :'String', + :'part12_fatca_status_under_iga_annex_ii' => :'String', + :'part12_trustee_name' => :'String', + :'part12_trustee_is_foreign' => :'Boolean', + :'part12_model2_iga_giin' => :'String', + :'box37_a_exchange' => :'String', + :'box37_b_exchange' => :'String', + :'box37_b_entity' => :'String', + :'part28_sponsoring_entity' => :'String', + :'part28_sponsoring_entity_giin' => :'String', + :'making_treaty_claim' => :'Boolean', + :'treaty_country' => :'String', + :'treaty_article' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'treaty_reasons' => :'String', + :'certify_box14_a' => :'Boolean', + :'certify_box14_b' => :'Boolean', + :'certify_box14_c' => :'Boolean', + :'certify_box17_1' => :'Boolean', + :'certify_box17_2' => :'Boolean', + :'certify_box18' => :'Boolean', + :'certify_box19' => :'Boolean', + :'certify_box21' => :'Boolean', + :'certify_box23' => :'Boolean', + :'certify_box24_d' => :'Boolean', + :'certify_box25_a' => :'Boolean', + :'certify_box25_b' => :'Boolean', + :'certify_box25_c' => :'Boolean', + :'certify_box27' => :'Boolean', + :'certify_box28_a' => :'Boolean', + :'certify_box28_b' => :'Boolean', + :'certify_box29_a' => :'Boolean', + :'certify_box29_b' => :'Boolean', + :'certify_box29_c' => :'Boolean', + :'certify_box29_d' => :'Boolean', + :'certify_box29_e' => :'Boolean', + :'certify_box29_f' => :'Boolean', + :'certify_box30' => :'Boolean', + :'certify_box33' => :'Boolean', + :'certify_box40_a' => :'Boolean', + :'certify_box40_b' => :'Boolean', + :'certify_box40_c' => :'Boolean', + :'certify_box41' => :'Boolean', + :'certify_box43' => :'Boolean', + :'certify_part29_signature' => :'Boolean', + :'part19_formation_or_resolution_date' => :'Time', + :'part20_filing_date' => :'Time', + :'part21_determination_date' => :'Time', + :'substantial_us_owners' => :'Array', + :'birthday' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'archived' => :'Boolean', + :'reference_id' => :'String', + :'company_id' => :'Integer', + :'signer_capacity' => :'String', + :'tin_match_status' => :'String', + :'signature' => :'String', + :'business_classification' => :'String', + :'business_name' => :'String', + :'business_other' => :'String', + :'exempt_payee_code' => :'String', + :'exempt_fatca_code' => :'String', + :'account_number' => :'String', + :'foreign_country_indicator' => :'Boolean', + :'foreign_address' => :'String', + :'backup_withholding' => :'Boolean', + :'is1099able' => :'Boolean', + :'foreign_partner_owner_or_beneficiary' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'signed_date', + :'disregarded_entity_chapter4_fatca_status', + :'created_at', + :'updated_at', + :'display_name', + :'email', + :'tin', + :'type_of_tin', + :'name', + :'citizenship_country', + :'chapter3_entity_type', + :'chapter4_fatca_status', + :'residence_address', + :'residence_city', + :'residence_state', + :'residence_postal_code', + :'residence_country', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_postal_code', + :'mailing_country', + :'disregarded_entity', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_postal_code', + :'disregarded_country', + :'disregarded_entity_giin', + :'ein', + :'ein_type', + :'giin', + :'foreign_tin', + :'reference_number', + :'box23_a_name_sponsoring_entity', + :'box27_a_name_sponsoring_entity', + :'box32_iga_country', + :'box32_iga_type', + :'box32_iga_treated_as', + :'box32_trustee_or_sponsor', + :'box37_a_securities_market', + :'box37_b_name_of_entity', + :'box37_b_securities_market', + :'box41_sponsoring_entity', + :'signer_name', + :'e_delivery_consented_at', + :'box35_formed_on_date', + :'box36_filed_on_date', + :'employee_first_name', + :'employee_middle_name', + :'employee_last_name', + :'employee_name_suffix', + :'address', + :'city', + :'state', + :'zip', + :'box3_marital_status', + :'box4_last_name_differs', + :'box5_num_allowances', + :'other_dependents', + :'non_job_income', + :'deductions', + :'box6_additional_withheld', + :'box7_exempt_from_withholding', + :'office_code', + :'ftin_not_required', + :'benefit_limitation', + :'part4_sponsoring_entity', + :'part4_sponsoring_entity_giin', + :'part7_sponsoring_entity', + :'part12_iga_country', + :'part12_iga_type', + :'part12_fatca_status_under_iga_annex_ii', + :'part12_trustee_name', + :'part12_trustee_is_foreign', + :'part12_model2_iga_giin', + :'box37_a_exchange', + :'box37_b_exchange', + :'box37_b_entity', + :'part28_sponsoring_entity', + :'part28_sponsoring_entity_giin', + :'making_treaty_claim', + :'treaty_country', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'part19_formation_or_resolution_date', + :'part20_filing_date', + :'part21_determination_date', + :'birthday', + :'foreign_tin_not_required', + :'archived', + :'reference_id', + :'company_id', + :'signer_capacity', + :'tin_match_status', + :'signature', + :'business_classification', + :'business_name', + :'business_other', + :'exempt_payee_code', + :'exempt_fatca_code', + :'account_number', + :'foreign_country_indicator', + :'foreign_address', + :'backup_withholding', + :'is1099able', + :'foreign_partner_owner_or_beneficiary' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'IW9FormDataModelsOneOf' + ] + 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::W8ImyFormDataModel` 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::W8ImyFormDataModel`. 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?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'disregarded_entity_chapter4_fatca_status') + self.disregarded_entity_chapter4_fatca_status = attributes[:'disregarded_entity_chapter4_fatca_status'] + 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + 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?(:'chapter3_entity_type') + self.chapter3_entity_type = attributes[:'chapter3_entity_type'] + end + + if attributes.key?(:'chapter4_fatca_status') + self.chapter4_fatca_status = attributes[:'chapter4_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_postal_code') + self.residence_postal_code = attributes[:'residence_postal_code'] + 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_postal_code') + self.mailing_postal_code = attributes[:'mailing_postal_code'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + 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_postal_code') + self.disregarded_postal_code = attributes[:'disregarded_postal_code'] + 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?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'ein_type') + self.ein_type = attributes[:'ein_type'] + 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?(:'certify_box14') + self.certify_box14 = attributes[:'certify_box14'] + end + + if attributes.key?(:'certify_box15_a') + self.certify_box15_a = attributes[:'certify_box15_a'] + end + + if attributes.key?(:'certify_box15_b') + self.certify_box15_b = attributes[:'certify_box15_b'] + end + + if attributes.key?(:'certify_box15_c') + self.certify_box15_c = attributes[:'certify_box15_c'] + end + + if attributes.key?(:'certify_box15_d') + self.certify_box15_d = attributes[:'certify_box15_d'] + end + + if attributes.key?(:'certify_box15_e') + self.certify_box15_e = attributes[:'certify_box15_e'] + end + + if attributes.key?(:'certify_box15_f') + self.certify_box15_f = attributes[:'certify_box15_f'] + end + + if attributes.key?(:'certify_box15_g') + self.certify_box15_g = attributes[:'certify_box15_g'] + end + + if attributes.key?(:'certify_box15_h') + self.certify_box15_h = attributes[:'certify_box15_h'] + end + + if attributes.key?(:'certify_box15_i') + self.certify_box15_i = attributes[:'certify_box15_i'] + end + + if attributes.key?(:'certify_box16_a') + self.certify_box16_a = attributes[:'certify_box16_a'] + end + + if attributes.key?(:'box16_b_qdd_corporate') + self.box16_b_qdd_corporate = attributes[:'box16_b_qdd_corporate'] + end + + if attributes.key?(:'box16_b_qdd_partnership') + self.box16_b_qdd_partnership = attributes[:'box16_b_qdd_partnership'] + end + + if attributes.key?(:'box16_b_qdd_disregarded_entity') + self.box16_b_qdd_disregarded_entity = attributes[:'box16_b_qdd_disregarded_entity'] + end + + if attributes.key?(:'certify_box17_a') + self.certify_box17_a = attributes[:'certify_box17_a'] + end + + if attributes.key?(:'certify_box17_b') + self.certify_box17_b = attributes[:'certify_box17_b'] + end + + if attributes.key?(:'certify_box17_c') + self.certify_box17_c = attributes[:'certify_box17_c'] + end + + if attributes.key?(:'certify_box17_d') + self.certify_box17_d = attributes[:'certify_box17_d'] + end + + if attributes.key?(:'certify_box17_e') + self.certify_box17_e = attributes[:'certify_box17_e'] + end + + if attributes.key?(:'certify_box18_a') + self.certify_box18_a = attributes[:'certify_box18_a'] + end + + if attributes.key?(:'certify_box18_b') + self.certify_box18_b = attributes[:'certify_box18_b'] + end + + if attributes.key?(:'certify_box18_c') + self.certify_box18_c = attributes[:'certify_box18_c'] + end + + if attributes.key?(:'certify_box18_d') + self.certify_box18_d = attributes[:'certify_box18_d'] + end + + if attributes.key?(:'certify_box18_e') + self.certify_box18_e = attributes[:'certify_box18_e'] + end + + if attributes.key?(:'certify_box18_f') + self.certify_box18_f = attributes[:'certify_box18_f'] + end + + if attributes.key?(:'certify_box19_a') + self.certify_box19_a = attributes[:'certify_box19_a'] + end + + if attributes.key?(:'certify_box19_b') + self.certify_box19_b = attributes[:'certify_box19_b'] + end + + if attributes.key?(:'certify_box19_c') + self.certify_box19_c = attributes[:'certify_box19_c'] + end + + if attributes.key?(:'certify_box19_d') + self.certify_box19_d = attributes[:'certify_box19_d'] + end + + if attributes.key?(:'certify_box19_e') + self.certify_box19_e = attributes[:'certify_box19_e'] + end + + if attributes.key?(:'certify_box19_f') + self.certify_box19_f = attributes[:'certify_box19_f'] + end + + if attributes.key?(:'certify_box20') + self.certify_box20 = attributes[:'certify_box20'] + end + + if attributes.key?(:'certify_box21_a') + self.certify_box21_a = attributes[:'certify_box21_a'] + end + + if attributes.key?(:'certify_box21_b') + self.certify_box21_b = attributes[:'certify_box21_b'] + end + + if attributes.key?(:'certify_box21_c') + self.certify_box21_c = attributes[:'certify_box21_c'] + end + + if attributes.key?(:'certify_box21_d') + self.certify_box21_d = attributes[:'certify_box21_d'] + end + + if attributes.key?(:'certify_box21_e') + self.certify_box21_e = attributes[:'certify_box21_e'] + end + + if attributes.key?(:'certify_box21_f') + self.certify_box21_f = attributes[:'certify_box21_f'] + end + + if attributes.key?(:'certify_box22') + self.certify_box22 = attributes[:'certify_box22'] + end + + if attributes.key?(:'box23_a_name_sponsoring_entity') + self.box23_a_name_sponsoring_entity = attributes[:'box23_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box23_b') + self.certify_box23_b = attributes[:'certify_box23_b'] + end + + if attributes.key?(:'certify_box23_c') + self.certify_box23_c = attributes[:'certify_box23_c'] + end + + if attributes.key?(:'certify_box24_a') + self.certify_box24_a = attributes[:'certify_box24_a'] + end + + if attributes.key?(:'certify_box24_b') + self.certify_box24_b = attributes[:'certify_box24_b'] + end + + if attributes.key?(:'certify_box24_c') + self.certify_box24_c = attributes[:'certify_box24_c'] + end + + if attributes.key?(:'certify_box25') + self.certify_box25 = attributes[:'certify_box25'] + end + + if attributes.key?(:'certify_box26') + self.certify_box26 = attributes[:'certify_box26'] + end + + if attributes.key?(:'box27_a_name_sponsoring_entity') + self.box27_a_name_sponsoring_entity = attributes[:'box27_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box27_b') + self.certify_box27_b = attributes[:'certify_box27_b'] + end + + if attributes.key?(:'certify_box28') + self.certify_box28 = attributes[:'certify_box28'] + end + + if attributes.key?(:'certify_box29') + self.certify_box29 = attributes[:'certify_box29'] + end + + if attributes.key?(:'certify_box30_a') + self.certify_box30_a = attributes[:'certify_box30_a'] + end + + if attributes.key?(:'certify_box30_b') + self.certify_box30_b = attributes[:'certify_box30_b'] + end + + if attributes.key?(:'certify_box30_c') + self.certify_box30_c = attributes[:'certify_box30_c'] + end + + if attributes.key?(:'certify_box31') + self.certify_box31 = attributes[:'certify_box31'] + end + + if attributes.key?(:'certify_box32') + self.certify_box32 = attributes[:'certify_box32'] + end + + if attributes.key?(:'box32_iga_country') + self.box32_iga_country = attributes[:'box32_iga_country'] + end + + if attributes.key?(:'box32_iga_type') + self.box32_iga_type = attributes[:'box32_iga_type'] + end + + if attributes.key?(:'box32_iga_treated_as') + self.box32_iga_treated_as = attributes[:'box32_iga_treated_as'] + end + + if attributes.key?(:'box32_trustee_or_sponsor') + self.box32_trustee_or_sponsor = attributes[:'box32_trustee_or_sponsor'] + end + + if attributes.key?(:'box32_trustee_is_foreign') + self.box32_trustee_is_foreign = attributes[:'box32_trustee_is_foreign'] + end + + if attributes.key?(:'certify_box33_a') + self.certify_box33_a = attributes[:'certify_box33_a'] + end + + if attributes.key?(:'certify_box33_b') + self.certify_box33_b = attributes[:'certify_box33_b'] + end + + if attributes.key?(:'certify_box33_c') + self.certify_box33_c = attributes[:'certify_box33_c'] + end + + if attributes.key?(:'certify_box33_d') + self.certify_box33_d = attributes[:'certify_box33_d'] + end + + if attributes.key?(:'certify_box33_e') + self.certify_box33_e = attributes[:'certify_box33_e'] + end + + if attributes.key?(:'certify_box33_f') + self.certify_box33_f = attributes[:'certify_box33_f'] + end + + if attributes.key?(:'certify_box34') + self.certify_box34 = attributes[:'certify_box34'] + end + + if attributes.key?(:'certify_box35') + self.certify_box35 = attributes[:'certify_box35'] + end + + if attributes.key?(:'certify_box36') + self.certify_box36 = attributes[:'certify_box36'] + end + + if attributes.key?(:'certify_box37_a') + self.certify_box37_a = attributes[:'certify_box37_a'] + end + + if attributes.key?(:'box37_a_securities_market') + self.box37_a_securities_market = attributes[:'box37_a_securities_market'] + end + + if attributes.key?(:'certify_box37_b') + self.certify_box37_b = attributes[:'certify_box37_b'] + end + + if attributes.key?(:'box37_b_name_of_entity') + self.box37_b_name_of_entity = attributes[:'box37_b_name_of_entity'] + end + + if attributes.key?(:'box37_b_securities_market') + self.box37_b_securities_market = attributes[:'box37_b_securities_market'] + end + + if attributes.key?(:'certify_box38') + self.certify_box38 = attributes[:'certify_box38'] + end + + if attributes.key?(:'certify_box39') + self.certify_box39 = attributes[:'certify_box39'] + end + + if attributes.key?(:'certify_box40') + self.certify_box40 = attributes[:'certify_box40'] + end + + if attributes.key?(:'box41_sponsoring_entity') + self.box41_sponsoring_entity = attributes[:'box41_sponsoring_entity'] + end + + if attributes.key?(:'certify_box42') + self.certify_box42 = attributes[:'certify_box42'] + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'box35_formed_on_date') + self.box35_formed_on_date = attributes[:'box35_formed_on_date'] + end + + if attributes.key?(:'box36_filed_on_date') + self.box36_filed_on_date = attributes[:'box36_filed_on_date'] + 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?(:'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?(:'box3_marital_status') + self.box3_marital_status = attributes[:'box3_marital_status'] + end + + if attributes.key?(:'box4_last_name_differs') + self.box4_last_name_differs = attributes[:'box4_last_name_differs'] + end + + if attributes.key?(:'box5_num_allowances') + self.box5_num_allowances = attributes[:'box5_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?(:'box6_additional_withheld') + self.box6_additional_withheld = attributes[:'box6_additional_withheld'] + end + + if attributes.key?(:'box7_exempt_from_withholding') + self.box7_exempt_from_withholding = attributes[:'box7_exempt_from_withholding'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'ftin_not_required') + self.ftin_not_required = attributes[:'ftin_not_required'] + end + + if attributes.key?(:'benefit_limitation') + self.benefit_limitation = attributes[:'benefit_limitation'] + end + + if attributes.key?(:'part4_sponsoring_entity') + self.part4_sponsoring_entity = attributes[:'part4_sponsoring_entity'] + end + + if attributes.key?(:'part4_sponsoring_entity_giin') + self.part4_sponsoring_entity_giin = attributes[:'part4_sponsoring_entity_giin'] + end + + if attributes.key?(:'part7_sponsoring_entity') + self.part7_sponsoring_entity = attributes[:'part7_sponsoring_entity'] + end + + if attributes.key?(:'part12_iga_country') + self.part12_iga_country = attributes[:'part12_iga_country'] + end + + if attributes.key?(:'part12_iga_type') + self.part12_iga_type = attributes[:'part12_iga_type'] + end + + if attributes.key?(:'part12_fatca_status_under_iga_annex_ii') + self.part12_fatca_status_under_iga_annex_ii = attributes[:'part12_fatca_status_under_iga_annex_ii'] + end + + if attributes.key?(:'part12_trustee_name') + self.part12_trustee_name = attributes[:'part12_trustee_name'] + end + + if attributes.key?(:'part12_trustee_is_foreign') + self.part12_trustee_is_foreign = attributes[:'part12_trustee_is_foreign'] + end + + if attributes.key?(:'part12_model2_iga_giin') + self.part12_model2_iga_giin = attributes[:'part12_model2_iga_giin'] + end + + if attributes.key?(:'box37_a_exchange') + self.box37_a_exchange = attributes[:'box37_a_exchange'] + end + + if attributes.key?(:'box37_b_exchange') + self.box37_b_exchange = attributes[:'box37_b_exchange'] + end + + if attributes.key?(:'box37_b_entity') + self.box37_b_entity = attributes[:'box37_b_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity') + self.part28_sponsoring_entity = attributes[:'part28_sponsoring_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity_giin') + self.part28_sponsoring_entity_giin = attributes[:'part28_sponsoring_entity_giin'] + end + + if attributes.key?(:'making_treaty_claim') + self.making_treaty_claim = attributes[:'making_treaty_claim'] + 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?(:'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?(:'certify_box14_a') + self.certify_box14_a = attributes[:'certify_box14_a'] + end + + if attributes.key?(:'certify_box14_b') + self.certify_box14_b = attributes[:'certify_box14_b'] + end + + if attributes.key?(:'certify_box14_c') + self.certify_box14_c = attributes[:'certify_box14_c'] + end + + if attributes.key?(:'certify_box17_1') + self.certify_box17_1 = attributes[:'certify_box17_1'] + end + + if attributes.key?(:'certify_box17_2') + self.certify_box17_2 = attributes[:'certify_box17_2'] + end + + if attributes.key?(:'certify_box18') + self.certify_box18 = attributes[:'certify_box18'] + end + + if attributes.key?(:'certify_box19') + self.certify_box19 = attributes[:'certify_box19'] + end + + if attributes.key?(:'certify_box21') + self.certify_box21 = attributes[:'certify_box21'] + end + + if attributes.key?(:'certify_box23') + self.certify_box23 = attributes[:'certify_box23'] + end + + if attributes.key?(:'certify_box24_d') + self.certify_box24_d = attributes[:'certify_box24_d'] + end + + if attributes.key?(:'certify_box25_a') + self.certify_box25_a = attributes[:'certify_box25_a'] + end + + if attributes.key?(:'certify_box25_b') + self.certify_box25_b = attributes[:'certify_box25_b'] + end + + if attributes.key?(:'certify_box25_c') + self.certify_box25_c = attributes[:'certify_box25_c'] + end + + if attributes.key?(:'certify_box27') + self.certify_box27 = attributes[:'certify_box27'] + end + + if attributes.key?(:'certify_box28_a') + self.certify_box28_a = attributes[:'certify_box28_a'] + end + + if attributes.key?(:'certify_box28_b') + self.certify_box28_b = attributes[:'certify_box28_b'] + end + + if attributes.key?(:'certify_box29_a') + self.certify_box29_a = attributes[:'certify_box29_a'] + end + + if attributes.key?(:'certify_box29_b') + self.certify_box29_b = attributes[:'certify_box29_b'] + end + + if attributes.key?(:'certify_box29_c') + self.certify_box29_c = attributes[:'certify_box29_c'] + end + + if attributes.key?(:'certify_box29_d') + self.certify_box29_d = attributes[:'certify_box29_d'] + end + + if attributes.key?(:'certify_box29_e') + self.certify_box29_e = attributes[:'certify_box29_e'] + end + + if attributes.key?(:'certify_box29_f') + self.certify_box29_f = attributes[:'certify_box29_f'] + end + + if attributes.key?(:'certify_box30') + self.certify_box30 = attributes[:'certify_box30'] + end + + if attributes.key?(:'certify_box33') + self.certify_box33 = attributes[:'certify_box33'] + end + + if attributes.key?(:'certify_box40_a') + self.certify_box40_a = attributes[:'certify_box40_a'] + end + + if attributes.key?(:'certify_box40_b') + self.certify_box40_b = attributes[:'certify_box40_b'] + end + + if attributes.key?(:'certify_box40_c') + self.certify_box40_c = attributes[:'certify_box40_c'] + end + + if attributes.key?(:'certify_box41') + self.certify_box41 = attributes[:'certify_box41'] + end + + if attributes.key?(:'certify_box43') + self.certify_box43 = attributes[:'certify_box43'] + end + + if attributes.key?(:'certify_part29_signature') + self.certify_part29_signature = attributes[:'certify_part29_signature'] + end + + if attributes.key?(:'part19_formation_or_resolution_date') + self.part19_formation_or_resolution_date = attributes[:'part19_formation_or_resolution_date'] + end + + if attributes.key?(:'part20_filing_date') + self.part20_filing_date = attributes[:'part20_filing_date'] + end + + if attributes.key?(:'part21_determination_date') + self.part21_determination_date = attributes[:'part21_determination_date'] + 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?(:'birthday') + self.birthday = attributes[:'birthday'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'signer_capacity') + self.signer_capacity = attributes[:'signer_capacity'] + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'business_classification') + self.business_classification = attributes[:'business_classification'] + end + + if attributes.key?(:'business_name') + self.business_name = attributes[:'business_name'] + end + + if attributes.key?(:'business_other') + self.business_other = attributes[:'business_other'] + 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?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'foreign_country_indicator') + self.foreign_country_indicator = attributes[:'foreign_country_indicator'] + end + + if attributes.key?(:'foreign_address') + self.foreign_address = attributes[:'foreign_address'] + 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?(:'foreign_partner_owner_or_beneficiary') + self.foreign_partner_owner_or_beneficiary = attributes[:'foreign_partner_owner_or_beneficiary'] + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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] substantial_us_owners Value to be assigned + def substantial_us_owners=(substantial_us_owners) + if substantial_us_owners.nil? + fail ArgumentError, 'substantial_us_owners cannot be nil' + end + + @substantial_us_owners = substantial_us_owners + 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 && + signed_date == o.signed_date && + disregarded_entity_chapter4_fatca_status == o.disregarded_entity_chapter4_fatca_status && + created_at == o.created_at && + updated_at == o.updated_at && + display_name == o.display_name && + email == o.email && + tin == o.tin && + type_of_tin == o.type_of_tin && + name == o.name && + citizenship_country == o.citizenship_country && + chapter3_entity_type == o.chapter3_entity_type && + chapter4_fatca_status == o.chapter4_fatca_status && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_postal_code == o.residence_postal_code && + 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_postal_code == o.mailing_postal_code && + mailing_country == o.mailing_country && + disregarded_entity == o.disregarded_entity && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_postal_code == o.disregarded_postal_code && + disregarded_country == o.disregarded_country && + disregarded_entity_giin == o.disregarded_entity_giin && + ein == o.ein && + ein_type == o.ein_type && + giin == o.giin && + foreign_tin == o.foreign_tin && + reference_number == o.reference_number && + certify_box14 == o.certify_box14 && + certify_box15_a == o.certify_box15_a && + certify_box15_b == o.certify_box15_b && + certify_box15_c == o.certify_box15_c && + certify_box15_d == o.certify_box15_d && + certify_box15_e == o.certify_box15_e && + certify_box15_f == o.certify_box15_f && + certify_box15_g == o.certify_box15_g && + certify_box15_h == o.certify_box15_h && + certify_box15_i == o.certify_box15_i && + certify_box16_a == o.certify_box16_a && + box16_b_qdd_corporate == o.box16_b_qdd_corporate && + box16_b_qdd_partnership == o.box16_b_qdd_partnership && + box16_b_qdd_disregarded_entity == o.box16_b_qdd_disregarded_entity && + certify_box17_a == o.certify_box17_a && + certify_box17_b == o.certify_box17_b && + certify_box17_c == o.certify_box17_c && + certify_box17_d == o.certify_box17_d && + certify_box17_e == o.certify_box17_e && + certify_box18_a == o.certify_box18_a && + certify_box18_b == o.certify_box18_b && + certify_box18_c == o.certify_box18_c && + certify_box18_d == o.certify_box18_d && + certify_box18_e == o.certify_box18_e && + certify_box18_f == o.certify_box18_f && + certify_box19_a == o.certify_box19_a && + certify_box19_b == o.certify_box19_b && + certify_box19_c == o.certify_box19_c && + certify_box19_d == o.certify_box19_d && + certify_box19_e == o.certify_box19_e && + certify_box19_f == o.certify_box19_f && + certify_box20 == o.certify_box20 && + certify_box21_a == o.certify_box21_a && + certify_box21_b == o.certify_box21_b && + certify_box21_c == o.certify_box21_c && + certify_box21_d == o.certify_box21_d && + certify_box21_e == o.certify_box21_e && + certify_box21_f == o.certify_box21_f && + certify_box22 == o.certify_box22 && + box23_a_name_sponsoring_entity == o.box23_a_name_sponsoring_entity && + certify_box23_b == o.certify_box23_b && + certify_box23_c == o.certify_box23_c && + certify_box24_a == o.certify_box24_a && + certify_box24_b == o.certify_box24_b && + certify_box24_c == o.certify_box24_c && + certify_box25 == o.certify_box25 && + certify_box26 == o.certify_box26 && + box27_a_name_sponsoring_entity == o.box27_a_name_sponsoring_entity && + certify_box27_b == o.certify_box27_b && + certify_box28 == o.certify_box28 && + certify_box29 == o.certify_box29 && + certify_box30_a == o.certify_box30_a && + certify_box30_b == o.certify_box30_b && + certify_box30_c == o.certify_box30_c && + certify_box31 == o.certify_box31 && + certify_box32 == o.certify_box32 && + box32_iga_country == o.box32_iga_country && + box32_iga_type == o.box32_iga_type && + box32_iga_treated_as == o.box32_iga_treated_as && + box32_trustee_or_sponsor == o.box32_trustee_or_sponsor && + box32_trustee_is_foreign == o.box32_trustee_is_foreign && + certify_box33_a == o.certify_box33_a && + certify_box33_b == o.certify_box33_b && + certify_box33_c == o.certify_box33_c && + certify_box33_d == o.certify_box33_d && + certify_box33_e == o.certify_box33_e && + certify_box33_f == o.certify_box33_f && + certify_box34 == o.certify_box34 && + certify_box35 == o.certify_box35 && + certify_box36 == o.certify_box36 && + certify_box37_a == o.certify_box37_a && + box37_a_securities_market == o.box37_a_securities_market && + certify_box37_b == o.certify_box37_b && + box37_b_name_of_entity == o.box37_b_name_of_entity && + box37_b_securities_market == o.box37_b_securities_market && + certify_box38 == o.certify_box38 && + certify_box39 == o.certify_box39 && + certify_box40 == o.certify_box40 && + box41_sponsoring_entity == o.box41_sponsoring_entity && + certify_box42 == o.certify_box42 && + signer_name == o.signer_name && + e_delivery_consented_at == o.e_delivery_consented_at && + box35_formed_on_date == o.box35_formed_on_date && + box36_filed_on_date == o.box36_filed_on_date && + 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 && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + box3_marital_status == o.box3_marital_status && + box4_last_name_differs == o.box4_last_name_differs && + box5_num_allowances == o.box5_num_allowances && + other_dependents == o.other_dependents && + non_job_income == o.non_job_income && + deductions == o.deductions && + box6_additional_withheld == o.box6_additional_withheld && + box7_exempt_from_withholding == o.box7_exempt_from_withholding && + office_code == o.office_code && + ftin_not_required == o.ftin_not_required && + benefit_limitation == o.benefit_limitation && + part4_sponsoring_entity == o.part4_sponsoring_entity && + part4_sponsoring_entity_giin == o.part4_sponsoring_entity_giin && + part7_sponsoring_entity == o.part7_sponsoring_entity && + part12_iga_country == o.part12_iga_country && + part12_iga_type == o.part12_iga_type && + part12_fatca_status_under_iga_annex_ii == o.part12_fatca_status_under_iga_annex_ii && + part12_trustee_name == o.part12_trustee_name && + part12_trustee_is_foreign == o.part12_trustee_is_foreign && + part12_model2_iga_giin == o.part12_model2_iga_giin && + box37_a_exchange == o.box37_a_exchange && + box37_b_exchange == o.box37_b_exchange && + box37_b_entity == o.box37_b_entity && + part28_sponsoring_entity == o.part28_sponsoring_entity && + part28_sponsoring_entity_giin == o.part28_sponsoring_entity_giin && + making_treaty_claim == o.making_treaty_claim && + treaty_country == o.treaty_country && + treaty_article == o.treaty_article && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + treaty_reasons == o.treaty_reasons && + certify_box14_a == o.certify_box14_a && + certify_box14_b == o.certify_box14_b && + certify_box14_c == o.certify_box14_c && + certify_box17_1 == o.certify_box17_1 && + certify_box17_2 == o.certify_box17_2 && + certify_box18 == o.certify_box18 && + certify_box19 == o.certify_box19 && + certify_box21 == o.certify_box21 && + certify_box23 == o.certify_box23 && + certify_box24_d == o.certify_box24_d && + certify_box25_a == o.certify_box25_a && + certify_box25_b == o.certify_box25_b && + certify_box25_c == o.certify_box25_c && + certify_box27 == o.certify_box27 && + certify_box28_a == o.certify_box28_a && + certify_box28_b == o.certify_box28_b && + certify_box29_a == o.certify_box29_a && + certify_box29_b == o.certify_box29_b && + certify_box29_c == o.certify_box29_c && + certify_box29_d == o.certify_box29_d && + certify_box29_e == o.certify_box29_e && + certify_box29_f == o.certify_box29_f && + certify_box30 == o.certify_box30 && + certify_box33 == o.certify_box33 && + certify_box40_a == o.certify_box40_a && + certify_box40_b == o.certify_box40_b && + certify_box40_c == o.certify_box40_c && + certify_box41 == o.certify_box41 && + certify_box43 == o.certify_box43 && + certify_part29_signature == o.certify_part29_signature && + part19_formation_or_resolution_date == o.part19_formation_or_resolution_date && + part20_filing_date == o.part20_filing_date && + part21_determination_date == o.part21_determination_date && + substantial_us_owners == o.substantial_us_owners && + birthday == o.birthday && + foreign_tin_not_required == o.foreign_tin_not_required && + archived == o.archived && + reference_id == o.reference_id && + company_id == o.company_id && + signer_capacity == o.signer_capacity && + tin_match_status == o.tin_match_status && + signature == o.signature && + business_classification == o.business_classification && + business_name == o.business_name && + business_other == o.business_other && + exempt_payee_code == o.exempt_payee_code && + exempt_fatca_code == o.exempt_fatca_code && + account_number == o.account_number && + foreign_country_indicator == o.foreign_country_indicator && + foreign_address == o.foreign_address && + backup_withholding == o.backup_withholding && + is1099able == o.is1099able && + foreign_partner_owner_or_beneficiary == o.foreign_partner_owner_or_beneficiary + 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, signed_date, disregarded_entity_chapter4_fatca_status, created_at, updated_at, display_name, email, tin, type_of_tin, name, citizenship_country, chapter3_entity_type, chapter4_fatca_status, residence_address, residence_city, residence_state, residence_postal_code, residence_country, residence_is_mailing, mailing_address, mailing_city, mailing_state, mailing_postal_code, mailing_country, disregarded_entity, disregarded_address, disregarded_city, disregarded_state, disregarded_postal_code, disregarded_country, disregarded_entity_giin, ein, ein_type, giin, foreign_tin, reference_number, certify_box14, certify_box15_a, certify_box15_b, certify_box15_c, certify_box15_d, certify_box15_e, certify_box15_f, certify_box15_g, certify_box15_h, certify_box15_i, certify_box16_a, box16_b_qdd_corporate, box16_b_qdd_partnership, box16_b_qdd_disregarded_entity, certify_box17_a, certify_box17_b, certify_box17_c, certify_box17_d, certify_box17_e, certify_box18_a, certify_box18_b, certify_box18_c, certify_box18_d, certify_box18_e, certify_box18_f, certify_box19_a, certify_box19_b, certify_box19_c, certify_box19_d, certify_box19_e, certify_box19_f, certify_box20, certify_box21_a, certify_box21_b, certify_box21_c, certify_box21_d, certify_box21_e, certify_box21_f, certify_box22, box23_a_name_sponsoring_entity, certify_box23_b, certify_box23_c, certify_box24_a, certify_box24_b, certify_box24_c, certify_box25, certify_box26, box27_a_name_sponsoring_entity, certify_box27_b, certify_box28, certify_box29, certify_box30_a, certify_box30_b, certify_box30_c, certify_box31, certify_box32, box32_iga_country, box32_iga_type, box32_iga_treated_as, box32_trustee_or_sponsor, box32_trustee_is_foreign, certify_box33_a, certify_box33_b, certify_box33_c, certify_box33_d, certify_box33_e, certify_box33_f, certify_box34, certify_box35, certify_box36, certify_box37_a, box37_a_securities_market, certify_box37_b, box37_b_name_of_entity, box37_b_securities_market, certify_box38, certify_box39, certify_box40, box41_sponsoring_entity, certify_box42, signer_name, e_delivery_consented_at, box35_formed_on_date, box36_filed_on_date, employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, address, city, state, zip, box3_marital_status, box4_last_name_differs, box5_num_allowances, other_dependents, non_job_income, deductions, box6_additional_withheld, box7_exempt_from_withholding, office_code, ftin_not_required, benefit_limitation, part4_sponsoring_entity, part4_sponsoring_entity_giin, part7_sponsoring_entity, part12_iga_country, part12_iga_type, part12_fatca_status_under_iga_annex_ii, part12_trustee_name, part12_trustee_is_foreign, part12_model2_iga_giin, box37_a_exchange, box37_b_exchange, box37_b_entity, part28_sponsoring_entity, part28_sponsoring_entity_giin, making_treaty_claim, treaty_country, treaty_article, withholding_rate, income_type, treaty_reasons, certify_box14_a, certify_box14_b, certify_box14_c, certify_box17_1, certify_box17_2, certify_box18, certify_box19, certify_box21, certify_box23, certify_box24_d, certify_box25_a, certify_box25_b, certify_box25_c, certify_box27, certify_box28_a, certify_box28_b, certify_box29_a, certify_box29_b, certify_box29_c, certify_box29_d, certify_box29_e, certify_box29_f, certify_box30, certify_box33, certify_box40_a, certify_box40_b, certify_box40_c, certify_box41, certify_box43, certify_part29_signature, part19_formation_or_resolution_date, part20_filing_date, part21_determination_date, substantial_us_owners, birthday, foreign_tin_not_required, archived, reference_id, company_id, signer_capacity, tin_match_status, signature, business_classification, business_name, business_other, exempt_payee_code, exempt_fatca_code, account_number, foreign_country_indicator, foreign_address, backup_withholding, is1099able, foreign_partner_owner_or_beneficiary].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 new file mode 100644 index 0000000..03673e7 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb @@ -0,0 +1,1497 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8ImyFormResponse + # 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 unique identifier for the form. + attr_accessor :id + + # The form type. + attr_accessor :type + + # The form status. + attr_accessor :entry_status + + # The timestamp for the latest status update. + attr_accessor :entry_status_date + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # Indicates whether the form is archived. + attr_accessor :archived + + # The signature of the form. + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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', + :'id' => :'id', + :'type' => :'type', + :'entry_status' => :'entryStatus', + :'entry_status_date' => :'entryStatusDate', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'archived' => :'archived', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'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' => :'Time', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'Boolean', + :'nonfinancial_entity_filing_date' => :'Time', + :'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', + :'id' => :'String', + :'type' => :'String', + :'entry_status' => :'String', + :'entry_status_date' => :'Time', + :'reference_id' => :'String', + :'company_id' => :'String', + :'display_name' => :'String', + :'email' => :'String', + :'archived' => :'Boolean', + :'signature' => :'String', + :'signed_date' => :'Time', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + 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', + :'ffi_sponsoring_entity', + :'sponsored_closely_held_entity_sponsoring_entity', + :'iga_country', + :'iga_model', + :'iga_legal_status_treatment', + :'iga_ffi_trustee_or_sponsor', + :'iga_ffi_trustee_is_foreign', + :'startup_formation_or_resolution_date', + :'nonfinancial_entity_filing_date', + :'publicly_traded_nffe_securities_market', + :'publicly_traded_entity', + :'nffe_affiliate_of_publicly_traded_entity_securities_market', + :'direct_reporting_nffe_sponsoring_entity', + :'signer_name', + :'entry_status_date', + :'reference_id', + :'email', + :'signature', + :'signed_date', + :'e_delivery_consented_at', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseResponse' + ] + 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::W8ImyFormResponse` 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::W8ImyFormResponse`. 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?(:'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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'entry_status') + self.entry_status = attributes[:'entry_status'] + end + + if attributes.key?(:'entry_status_date') + self.entry_status_date = attributes[:'entry_status_date'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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 + 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 && + 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 && + id == o.id && + type == o.type && + entry_status == o.entry_status && + entry_status_date == o.entry_status_date && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + archived == o.archived && + signature == o.signature && + signed_date == o.signed_date && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at + 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, 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, id, type, entry_status, entry_status_date, reference_id, company_id, display_name, email, archived, signature, signed_date, e_delivery_consented_at, created_at, updated_at].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 new file mode 100644 index 0000000..d67f68d --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb @@ -0,0 +1,347 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W9FormBaseResponse + # The unique identifier for the form. + attr_accessor :id + + # The form type. + attr_accessor :type + + # The form status. + attr_accessor :entry_status + + # The timestamp for the latest status update. + attr_accessor :entry_status_date + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # Indicates whether the form is archived. + attr_accessor :archived + + # The signature of the form. + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'entry_status' => :'entryStatus', + :'entry_status_date' => :'entryStatusDate', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'archived' => :'archived', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'entry_status' => :'String', + :'entry_status_date' => :'Time', + :'reference_id' => :'String', + :'company_id' => :'String', + :'display_name' => :'String', + :'email' => :'String', + :'archived' => :'Boolean', + :'signature' => :'String', + :'signed_date' => :'Time', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'entry_status_date', + :'reference_id', + :'email', + :'signature', + :'signed_date', + :'e_delivery_consented_at', + ]) + 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::W9FormBaseResponse` 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::W9FormBaseResponse`. 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?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'entry_status') + self.entry_status = attributes[:'entry_status'] + end + + if attributes.key?(:'entry_status_date') + self.entry_status_date = attributes[:'entry_status_date'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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 + 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 && + type == o.type && + entry_status == o.entry_status && + entry_status_date == o.entry_status_date && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + archived == o.archived && + signature == o.signature && + signed_date == o.signed_date && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at + 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, entry_status, entry_status_date, reference_id, company_id, display_name, email, archived, signature, signed_date, e_delivery_consented_at, created_at, updated_at].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_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb new file mode 100644 index 0000000..5fb9775 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb @@ -0,0 +1,2442 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W9FormDataModel + # Type of the form, always W9 for this model. + attr_accessor :type + + # The status of the TIN match. + attr_accessor :tin_match_status + + # The signature itself + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # The classification of the business. + attr_accessor :business_classification + + # The name of the business associated with the form. + attr_accessor :business_name + + attr_accessor :business_other + + attr_accessor :exempt_payee_code + + attr_accessor :exempt_fatca_code + + # The type of TIN provided. + attr_accessor :type_of_tin + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # The address of the individual or entity. + attr_accessor :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 + + # Indicates whether the individual or entity is in a foreign country. + attr_accessor :foreign_country_indicator + + # The foreign address of the individual or entity. + attr_accessor :foreign_address + + # Indicates whether backup withholding applies. + attr_accessor :backup_withholding + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + attr_accessor :is1099able + + # Indicates whether the individual is a foreign partner, owner, or beneficiary. + attr_accessor :foreign_partner_owner_or_beneficiary + + # The creation date of the form. + attr_accessor :created_at + + # 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 marital status of the employee. + attr_accessor :box3_marital_status + + # Indicates whether the last name differs from prior records. + attr_accessor :box4_last_name_differs + + # The number of allowances claimed by the employee. + attr_accessor :box5_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 :box6_additional_withheld + + # Indicates whether the employee is exempt from withholding. + attr_accessor :box7_exempt_from_withholding + + # The office code associated with the form. + attr_accessor :office_code + + # The FATCA status for disregarded entities under Chapter 4. + attr_accessor :disregarded_entity_chapter4_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 postal code of the residence. + attr_accessor :residence_postal_code + + # The country of residence. + attr_accessor :residence_country + + # 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 postal code of the mailing address. + attr_accessor :mailing_postal_code + + # The country of the mailing address. + attr_accessor :mailing_country + + # 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 postal code for disregarded entities. + attr_accessor :disregarded_postal_code + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # Indicates whether a foreign TIN is not required. + attr_accessor :ftin_not_required + + # A reference number for the form. + attr_accessor :reference_number + + # The global intermediary identification number (GIIN). + attr_accessor :giin + + # The Chapter 3 entity type. + attr_accessor :chapter3_entity_type + + # The Chapter 4 FATCA status. + attr_accessor :chapter4_fatca_status + + # The disregarded entity information. + attr_accessor :disregarded_entity + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # The benefit limitation for tax treaty claims. + attr_accessor :benefit_limitation + + # The sponsoring entity information for Part 4. + attr_accessor :part4_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 4. + attr_accessor :part4_sponsoring_entity_giin + + # The sponsoring entity information for Part 7. + attr_accessor :part7_sponsoring_entity + + # The IGA country information for Part 12. + attr_accessor :part12_iga_country + + # The IGA type information for Part 12. + attr_accessor :part12_iga_type + + # The FATCA status under IGA Annex II for Part 12. + attr_accessor :part12_fatca_status_under_iga_annex_ii + + # The trustee name for Part 12. + attr_accessor :part12_trustee_name + + # Indicates whether the trustee is foreign for Part 12. + attr_accessor :part12_trustee_is_foreign + + # The GIIN for Model 2 IGA in Part 12. + attr_accessor :part12_model2_iga_giin + + # The exchange information for Box 37A. + attr_accessor :box37_a_exchange + + # The exchange information for Box 37B. + attr_accessor :box37_b_exchange + + # The entity information for Box 37B. + attr_accessor :box37_b_entity + + # The sponsoring entity information for Part 28. + attr_accessor :part28_sponsoring_entity + + # The GIIN for the sponsoring entity in Part 28. + attr_accessor :part28_sponsoring_entity_giin + + # The name of the signer of the form. + attr_accessor :signer_name + + # Indicates whether the residence address is also the mailing address. + attr_accessor :residence_is_mailing + + # The country of citizenship. + attr_accessor :citizenship_country + + attr_accessor :making_treaty_claim + + # The country for which the treaty applies. + attr_accessor :treaty_country + + # The specific article of the treaty being claimed. + attr_accessor :treaty_article + + # 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 reasons for claiming treaty benefits. + attr_accessor :treaty_reasons + + attr_accessor :certify_box14_a + + attr_accessor :certify_box14_b + + attr_accessor :certify_box14_c + + attr_accessor :certify_box17_1 + + attr_accessor :certify_box17_2 + + attr_accessor :certify_box18 + + attr_accessor :certify_box19 + + attr_accessor :certify_box21 + + # Indicates certification for box 22. + attr_accessor :certify_box22 + + attr_accessor :certify_box23 + + # Indicates certification for box 24A. + attr_accessor :certify_box24_a + + # Indicates certification for box 24B. + attr_accessor :certify_box24_b + + # Indicates certification for box 24C. + attr_accessor :certify_box24_c + + attr_accessor :certify_box24_d + + attr_accessor :certify_box25_a + + attr_accessor :certify_box25_b + + attr_accessor :certify_box25_c + + # Indicates certification for box 26. + attr_accessor :certify_box26 + + attr_accessor :certify_box27 + + attr_accessor :certify_box28_a + + attr_accessor :certify_box28_b + + attr_accessor :certify_box29_a + + attr_accessor :certify_box29_b + + attr_accessor :certify_box29_c + + attr_accessor :certify_box29_d + + attr_accessor :certify_box29_e + + attr_accessor :certify_box29_f + + attr_accessor :certify_box30 + + # Indicates certification for box 31. + attr_accessor :certify_box31 + + # Indicates certification for box 32. + attr_accessor :certify_box32 + + attr_accessor :certify_box33 + + # Indicates certification for box 34. + attr_accessor :certify_box34 + + # Indicates certification for box 35. + attr_accessor :certify_box35 + + # Indicates certification for box 36. + attr_accessor :certify_box36 + + # Indicates certification for box 37A. + attr_accessor :certify_box37_a + + # Indicates certification for box 37B. + attr_accessor :certify_box37_b + + # Indicates certification for box 38. + attr_accessor :certify_box38 + + # Indicates certification for box 39. + attr_accessor :certify_box39 + + attr_accessor :certify_box40_a + + attr_accessor :certify_box40_b + + attr_accessor :certify_box40_c + + attr_accessor :certify_box41 + + attr_accessor :certify_box43 + + attr_accessor :certify_part29_signature + + attr_accessor :part19_formation_or_resolution_date + + attr_accessor :part20_filing_date + + attr_accessor :part21_determination_date + + attr_accessor :substantial_us_owners + + # The birthday of the individual associated with the form. + attr_accessor :birthday + + # Indicates whether a foreign TIN is not required. + attr_accessor :foreign_tin_not_required + + # Indicates whether the form is archived. + attr_accessor :archived + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # The capacity in which the signer is signing the form. + attr_accessor :signer_capacity + + # The last updated date of the form. + attr_accessor :updated_at + + # The employer identification number (EIN). + attr_accessor :ein + + # The type of employer identification number (EIN). + attr_accessor :ein_type + + # Indicates certification for box 14. + attr_accessor :certify_box14 + + # Indicates certification for box 15A. + attr_accessor :certify_box15_a + + # Indicates certification for box 15B. + attr_accessor :certify_box15_b + + # Indicates certification for box 15C. + attr_accessor :certify_box15_c + + # Indicates certification for box 15D. + attr_accessor :certify_box15_d + + # Indicates certification for box 15E. + attr_accessor :certify_box15_e + + # Indicates certification for box 15F. + attr_accessor :certify_box15_f + + # Indicates certification for box 15G. + attr_accessor :certify_box15_g + + # Indicates certification for box 15H. + attr_accessor :certify_box15_h + + # Indicates certification for box 15I. + attr_accessor :certify_box15_i + + # Indicates certification for box 16A. + attr_accessor :certify_box16_a + + # Indicates certification for box 16B as a QDD corporate entity. + attr_accessor :box16_b_qdd_corporate + + # Indicates certification for box 16B as a QDD partnership. + attr_accessor :box16_b_qdd_partnership + + # Indicates certification for box 16B as a QDD disregarded entity. + attr_accessor :box16_b_qdd_disregarded_entity + + # Indicates certification for box 17A. + attr_accessor :certify_box17_a + + # Indicates certification for box 17B. + attr_accessor :certify_box17_b + + # Indicates certification for box 17C. + attr_accessor :certify_box17_c + + # Indicates certification for box 17D. + attr_accessor :certify_box17_d + + # Indicates certification for box 17E. + attr_accessor :certify_box17_e + + # Indicates certification for box 18A. + attr_accessor :certify_box18_a + + # Indicates certification for box 18B. + attr_accessor :certify_box18_b + + # Indicates certification for box 18C. + attr_accessor :certify_box18_c + + # Indicates certification for box 18D. + attr_accessor :certify_box18_d + + # Indicates certification for box 18E. + attr_accessor :certify_box18_e + + # Indicates certification for box 18F. + attr_accessor :certify_box18_f + + # Indicates certification for box 19A. + attr_accessor :certify_box19_a + + # Indicates certification for box 19B. + attr_accessor :certify_box19_b + + # Indicates certification for box 19C. + attr_accessor :certify_box19_c + + # Indicates certification for box 19D. + attr_accessor :certify_box19_d + + # Indicates certification for box 19E. + attr_accessor :certify_box19_e + + # Indicates certification for box 19F. + attr_accessor :certify_box19_f + + # Indicates certification for box 20. + attr_accessor :certify_box20 + + # Indicates certification for box 21A. + attr_accessor :certify_box21_a + + # Indicates certification for box 21B. + attr_accessor :certify_box21_b + + # Indicates certification for box 21C. + attr_accessor :certify_box21_c + + # Indicates certification for box 21D. + attr_accessor :certify_box21_d + + # Indicates certification for box 21E. + attr_accessor :certify_box21_e + + # Indicates certification for box 21F. + attr_accessor :certify_box21_f + + # The name of the sponsoring entity for box 23A. + attr_accessor :box23_a_name_sponsoring_entity + + # Indicates certification for box 23B. + attr_accessor :certify_box23_b + + # Indicates certification for box 23C. + attr_accessor :certify_box23_c + + # Indicates certification for box 25. + attr_accessor :certify_box25 + + # The name of the sponsoring entity for box 27A. + attr_accessor :box27_a_name_sponsoring_entity + + # Indicates certification for box 27B. + attr_accessor :certify_box27_b + + # Indicates certification for box 28. + attr_accessor :certify_box28 + + # Indicates certification for box 29. + attr_accessor :certify_box29 + + # Indicates certification for box 30A. + attr_accessor :certify_box30_a + + # Indicates certification for box 30B. + attr_accessor :certify_box30_b + + # Indicates certification for box 30C. + attr_accessor :certify_box30_c + + # The IGA country information for box 32. + attr_accessor :box32_iga_country + + # The IGA type information for box 32. + attr_accessor :box32_iga_type + + # The IGA treatment information for box 32. + attr_accessor :box32_iga_treated_as + + # The trustee or sponsor information for box 32. + attr_accessor :box32_trustee_or_sponsor + + # Indicates whether the trustee is foreign for box 32. + attr_accessor :box32_trustee_is_foreign + + # Indicates certification for box 33A. + attr_accessor :certify_box33_a + + # Indicates certification for box 33B. + attr_accessor :certify_box33_b + + # Indicates certification for box 33C. + attr_accessor :certify_box33_c + + # Indicates certification for box 33D. + attr_accessor :certify_box33_d + + # Indicates certification for box 33E. + attr_accessor :certify_box33_e + + # Indicates certification for box 33F. + attr_accessor :certify_box33_f + + # The securities market information for box 37A. + attr_accessor :box37_a_securities_market + + # The name of the entity for box 37B. + attr_accessor :box37_b_name_of_entity + + # The securities market information for box 37B. + attr_accessor :box37_b_securities_market + + # Indicates certification for box 40. + attr_accessor :certify_box40 + + # The sponsoring entity information for box 41. + attr_accessor :box41_sponsoring_entity + + # Indicates certification for box 42. + attr_accessor :certify_box42 + + attr_accessor :box35_formed_on_date + + attr_accessor :box36_filed_on_date + + 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', + :'tin_match_status' => :'tinMatchStatus', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'name' => :'name', + :'business_classification' => :'businessClassification', + :'business_name' => :'businessName', + :'business_other' => :'businessOther', + :'exempt_payee_code' => :'exemptPayeeCode', + :'exempt_fatca_code' => :'exemptFatcaCode', + :'type_of_tin' => :'typeOfTin', + :'tin' => :'tin', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'account_number' => :'accountNumber', + :'foreign_country_indicator' => :'foreignCountryIndicator', + :'foreign_address' => :'foreignAddress', + :'backup_withholding' => :'backupWithholding', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'is1099able' => :'is1099able', + :'foreign_partner_owner_or_beneficiary' => :'foreignPartnerOwnerOrBeneficiary', + :'created_at' => :'createdAt', + :'employee_first_name' => :'employeeFirstName', + :'employee_middle_name' => :'employeeMiddleName', + :'employee_last_name' => :'employeeLastName', + :'employee_name_suffix' => :'employeeNameSuffix', + :'box3_marital_status' => :'box3MaritalStatus', + :'box4_last_name_differs' => :'box4LastNameDiffers', + :'box5_num_allowances' => :'box5NumAllowances', + :'other_dependents' => :'otherDependents', + :'non_job_income' => :'nonJobIncome', + :'deductions' => :'deductions', + :'box6_additional_withheld' => :'box6AdditionalWithheld', + :'box7_exempt_from_withholding' => :'box7ExemptFromWithholding', + :'office_code' => :'officeCode', + :'disregarded_entity_chapter4_fatca_status' => :'disregardedEntityChapter4FatcaStatus', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_postal_code' => :'residencePostalCode', + :'residence_country' => :'residenceCountry', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_postal_code' => :'mailingPostalCode', + :'mailing_country' => :'mailingCountry', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_postal_code' => :'disregardedPostalCode', + :'disregarded_country' => :'disregardedCountry', + :'foreign_tin' => :'foreignTin', + :'ftin_not_required' => :'ftinNotRequired', + :'reference_number' => :'referenceNumber', + :'giin' => :'giin', + :'chapter3_entity_type' => :'chapter3EntityType', + :'chapter4_fatca_status' => :'chapter4FatcaStatus', + :'disregarded_entity' => :'disregardedEntity', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'benefit_limitation' => :'benefitLimitation', + :'part4_sponsoring_entity' => :'part4SponsoringEntity', + :'part4_sponsoring_entity_giin' => :'part4SponsoringEntityGiin', + :'part7_sponsoring_entity' => :'part7SponsoringEntity', + :'part12_iga_country' => :'part12IgaCountry', + :'part12_iga_type' => :'part12IgaType', + :'part12_fatca_status_under_iga_annex_ii' => :'part12FatcaStatusUnderIgaAnnexIi', + :'part12_trustee_name' => :'part12TrusteeName', + :'part12_trustee_is_foreign' => :'part12TrusteeIsForeign', + :'part12_model2_iga_giin' => :'part12Model2IgaGiin', + :'box37_a_exchange' => :'box37AExchange', + :'box37_b_exchange' => :'box37BExchange', + :'box37_b_entity' => :'box37BEntity', + :'part28_sponsoring_entity' => :'part28SponsoringEntity', + :'part28_sponsoring_entity_giin' => :'part28SponsoringEntityGiin', + :'signer_name' => :'signerName', + :'residence_is_mailing' => :'residenceIsMailing', + :'citizenship_country' => :'citizenshipCountry', + :'making_treaty_claim' => :'makingTreatyClaim', + :'treaty_country' => :'treatyCountry', + :'treaty_article' => :'treatyArticle', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'treaty_reasons' => :'treatyReasons', + :'certify_box14_a' => :'certifyBox14A', + :'certify_box14_b' => :'certifyBox14B', + :'certify_box14_c' => :'certifyBox14C', + :'certify_box17_1' => :'certifyBox17_1', + :'certify_box17_2' => :'certifyBox17_2', + :'certify_box18' => :'certifyBox18', + :'certify_box19' => :'certifyBox19', + :'certify_box21' => :'certifyBox21', + :'certify_box22' => :'certifyBox22', + :'certify_box23' => :'certifyBox23', + :'certify_box24_a' => :'certifyBox24A', + :'certify_box24_b' => :'certifyBox24B', + :'certify_box24_c' => :'certifyBox24C', + :'certify_box24_d' => :'certifyBox24D', + :'certify_box25_a' => :'certifyBox25A', + :'certify_box25_b' => :'certifyBox25B', + :'certify_box25_c' => :'certifyBox25C', + :'certify_box26' => :'certifyBox26', + :'certify_box27' => :'certifyBox27', + :'certify_box28_a' => :'certifyBox28A', + :'certify_box28_b' => :'certifyBox28B', + :'certify_box29_a' => :'certifyBox29A', + :'certify_box29_b' => :'certifyBox29B', + :'certify_box29_c' => :'certifyBox29C', + :'certify_box29_d' => :'certifyBox29D', + :'certify_box29_e' => :'certifyBox29E', + :'certify_box29_f' => :'certifyBox29F', + :'certify_box30' => :'certifyBox30', + :'certify_box31' => :'certifyBox31', + :'certify_box32' => :'certifyBox32', + :'certify_box33' => :'certifyBox33', + :'certify_box34' => :'certifyBox34', + :'certify_box35' => :'certifyBox35', + :'certify_box36' => :'certifyBox36', + :'certify_box37_a' => :'certifyBox37A', + :'certify_box37_b' => :'certifyBox37B', + :'certify_box38' => :'certifyBox38', + :'certify_box39' => :'certifyBox39', + :'certify_box40_a' => :'certifyBox40A', + :'certify_box40_b' => :'certifyBox40B', + :'certify_box40_c' => :'certifyBox40C', + :'certify_box41' => :'certifyBox41', + :'certify_box43' => :'certifyBox43', + :'certify_part29_signature' => :'certifyPart29Signature', + :'part19_formation_or_resolution_date' => :'part19FormationOrResolutionDate', + :'part20_filing_date' => :'part20FilingDate', + :'part21_determination_date' => :'part21DeterminationDate', + :'substantial_us_owners' => :'substantialUsOwners', + :'birthday' => :'birthday', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'archived' => :'archived', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'signer_capacity' => :'signerCapacity', + :'updated_at' => :'updatedAt', + :'ein' => :'ein', + :'ein_type' => :'einType', + :'certify_box14' => :'certifyBox14', + :'certify_box15_a' => :'certifyBox15A', + :'certify_box15_b' => :'certifyBox15B', + :'certify_box15_c' => :'certifyBox15C', + :'certify_box15_d' => :'certifyBox15D', + :'certify_box15_e' => :'certifyBox15E', + :'certify_box15_f' => :'certifyBox15F', + :'certify_box15_g' => :'certifyBox15G', + :'certify_box15_h' => :'certifyBox15H', + :'certify_box15_i' => :'certifyBox15I', + :'certify_box16_a' => :'certifyBox16A', + :'box16_b_qdd_corporate' => :'box16BQddCorporate', + :'box16_b_qdd_partnership' => :'box16BQddPartnership', + :'box16_b_qdd_disregarded_entity' => :'box16BQddDisregardedEntity', + :'certify_box17_a' => :'certifyBox17A', + :'certify_box17_b' => :'certifyBox17B', + :'certify_box17_c' => :'certifyBox17C', + :'certify_box17_d' => :'certifyBox17D', + :'certify_box17_e' => :'certifyBox17E', + :'certify_box18_a' => :'certifyBox18A', + :'certify_box18_b' => :'certifyBox18B', + :'certify_box18_c' => :'certifyBox18C', + :'certify_box18_d' => :'certifyBox18D', + :'certify_box18_e' => :'certifyBox18E', + :'certify_box18_f' => :'certifyBox18F', + :'certify_box19_a' => :'certifyBox19A', + :'certify_box19_b' => :'certifyBox19B', + :'certify_box19_c' => :'certifyBox19C', + :'certify_box19_d' => :'certifyBox19D', + :'certify_box19_e' => :'certifyBox19E', + :'certify_box19_f' => :'certifyBox19F', + :'certify_box20' => :'certifyBox20', + :'certify_box21_a' => :'certifyBox21A', + :'certify_box21_b' => :'certifyBox21B', + :'certify_box21_c' => :'certifyBox21C', + :'certify_box21_d' => :'certifyBox21D', + :'certify_box21_e' => :'certifyBox21E', + :'certify_box21_f' => :'certifyBox21F', + :'box23_a_name_sponsoring_entity' => :'box23ANameSponsoringEntity', + :'certify_box23_b' => :'certifyBox23B', + :'certify_box23_c' => :'certifyBox23C', + :'certify_box25' => :'certifyBox25', + :'box27_a_name_sponsoring_entity' => :'box27ANameSponsoringEntity', + :'certify_box27_b' => :'certifyBox27B', + :'certify_box28' => :'certifyBox28', + :'certify_box29' => :'certifyBox29', + :'certify_box30_a' => :'certifyBox30A', + :'certify_box30_b' => :'certifyBox30B', + :'certify_box30_c' => :'certifyBox30C', + :'box32_iga_country' => :'box32IgaCountry', + :'box32_iga_type' => :'box32IgaType', + :'box32_iga_treated_as' => :'box32IgaTreatedAs', + :'box32_trustee_or_sponsor' => :'box32TrusteeOrSponsor', + :'box32_trustee_is_foreign' => :'box32TrusteeIsForeign', + :'certify_box33_a' => :'certifyBox33A', + :'certify_box33_b' => :'certifyBox33B', + :'certify_box33_c' => :'certifyBox33C', + :'certify_box33_d' => :'certifyBox33D', + :'certify_box33_e' => :'certifyBox33E', + :'certify_box33_f' => :'certifyBox33F', + :'box37_a_securities_market' => :'box37ASecuritiesMarket', + :'box37_b_name_of_entity' => :'box37BNameOfEntity', + :'box37_b_securities_market' => :'box37BSecuritiesMarket', + :'certify_box40' => :'certifyBox40', + :'box41_sponsoring_entity' => :'box41SponsoringEntity', + :'certify_box42' => :'certifyBox42', + :'box35_formed_on_date' => :'box35FormedOnDate', + :'box36_filed_on_date' => :'box36FiledOnDate' + } + 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', + :'tin_match_status' => :'String', + :'signature' => :'String', + :'signed_date' => :'Time', + :'name' => :'String', + :'business_classification' => :'String', + :'business_name' => :'String', + :'business_other' => :'String', + :'exempt_payee_code' => :'String', + :'exempt_fatca_code' => :'String', + :'type_of_tin' => :'String', + :'tin' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'account_number' => :'String', + :'foreign_country_indicator' => :'Boolean', + :'foreign_address' => :'String', + :'backup_withholding' => :'Boolean', + :'e_delivery_consented_at' => :'Time', + :'is1099able' => :'Boolean', + :'foreign_partner_owner_or_beneficiary' => :'Boolean', + :'created_at' => :'Time', + :'employee_first_name' => :'String', + :'employee_middle_name' => :'String', + :'employee_last_name' => :'String', + :'employee_name_suffix' => :'String', + :'box3_marital_status' => :'String', + :'box4_last_name_differs' => :'Boolean', + :'box5_num_allowances' => :'Integer', + :'other_dependents' => :'Integer', + :'non_job_income' => :'Float', + :'deductions' => :'Float', + :'box6_additional_withheld' => :'Float', + :'box7_exempt_from_withholding' => :'Boolean', + :'office_code' => :'String', + :'disregarded_entity_chapter4_fatca_status' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_postal_code' => :'String', + :'residence_country' => :'String', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_postal_code' => :'String', + :'mailing_country' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_postal_code' => :'String', + :'disregarded_country' => :'String', + :'foreign_tin' => :'String', + :'ftin_not_required' => :'Boolean', + :'reference_number' => :'String', + :'giin' => :'String', + :'chapter3_entity_type' => :'String', + :'chapter4_fatca_status' => :'String', + :'disregarded_entity' => :'String', + :'disregarded_entity_giin' => :'String', + :'benefit_limitation' => :'String', + :'part4_sponsoring_entity' => :'String', + :'part4_sponsoring_entity_giin' => :'String', + :'part7_sponsoring_entity' => :'String', + :'part12_iga_country' => :'String', + :'part12_iga_type' => :'String', + :'part12_fatca_status_under_iga_annex_ii' => :'String', + :'part12_trustee_name' => :'String', + :'part12_trustee_is_foreign' => :'Boolean', + :'part12_model2_iga_giin' => :'String', + :'box37_a_exchange' => :'String', + :'box37_b_exchange' => :'String', + :'box37_b_entity' => :'String', + :'part28_sponsoring_entity' => :'String', + :'part28_sponsoring_entity_giin' => :'String', + :'signer_name' => :'String', + :'residence_is_mailing' => :'Boolean', + :'citizenship_country' => :'String', + :'making_treaty_claim' => :'Boolean', + :'treaty_country' => :'String', + :'treaty_article' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'treaty_reasons' => :'String', + :'certify_box14_a' => :'Boolean', + :'certify_box14_b' => :'Boolean', + :'certify_box14_c' => :'Boolean', + :'certify_box17_1' => :'Boolean', + :'certify_box17_2' => :'Boolean', + :'certify_box18' => :'Boolean', + :'certify_box19' => :'Boolean', + :'certify_box21' => :'Boolean', + :'certify_box22' => :'Boolean', + :'certify_box23' => :'Boolean', + :'certify_box24_a' => :'Boolean', + :'certify_box24_b' => :'Boolean', + :'certify_box24_c' => :'Boolean', + :'certify_box24_d' => :'Boolean', + :'certify_box25_a' => :'Boolean', + :'certify_box25_b' => :'Boolean', + :'certify_box25_c' => :'Boolean', + :'certify_box26' => :'Boolean', + :'certify_box27' => :'Boolean', + :'certify_box28_a' => :'Boolean', + :'certify_box28_b' => :'Boolean', + :'certify_box29_a' => :'Boolean', + :'certify_box29_b' => :'Boolean', + :'certify_box29_c' => :'Boolean', + :'certify_box29_d' => :'Boolean', + :'certify_box29_e' => :'Boolean', + :'certify_box29_f' => :'Boolean', + :'certify_box30' => :'Boolean', + :'certify_box31' => :'Boolean', + :'certify_box32' => :'Boolean', + :'certify_box33' => :'Boolean', + :'certify_box34' => :'Boolean', + :'certify_box35' => :'Boolean', + :'certify_box36' => :'Boolean', + :'certify_box37_a' => :'Boolean', + :'certify_box37_b' => :'Boolean', + :'certify_box38' => :'Boolean', + :'certify_box39' => :'Boolean', + :'certify_box40_a' => :'Boolean', + :'certify_box40_b' => :'Boolean', + :'certify_box40_c' => :'Boolean', + :'certify_box41' => :'Boolean', + :'certify_box43' => :'Boolean', + :'certify_part29_signature' => :'Boolean', + :'part19_formation_or_resolution_date' => :'Time', + :'part20_filing_date' => :'Time', + :'part21_determination_date' => :'Time', + :'substantial_us_owners' => :'Array', + :'birthday' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'archived' => :'Boolean', + :'reference_id' => :'String', + :'company_id' => :'Integer', + :'display_name' => :'String', + :'email' => :'String', + :'signer_capacity' => :'String', + :'updated_at' => :'Time', + :'ein' => :'String', + :'ein_type' => :'String', + :'certify_box14' => :'Boolean', + :'certify_box15_a' => :'Boolean', + :'certify_box15_b' => :'Boolean', + :'certify_box15_c' => :'Boolean', + :'certify_box15_d' => :'Boolean', + :'certify_box15_e' => :'Boolean', + :'certify_box15_f' => :'Boolean', + :'certify_box15_g' => :'Boolean', + :'certify_box15_h' => :'Boolean', + :'certify_box15_i' => :'Boolean', + :'certify_box16_a' => :'Boolean', + :'box16_b_qdd_corporate' => :'Boolean', + :'box16_b_qdd_partnership' => :'Boolean', + :'box16_b_qdd_disregarded_entity' => :'Boolean', + :'certify_box17_a' => :'Boolean', + :'certify_box17_b' => :'Boolean', + :'certify_box17_c' => :'Boolean', + :'certify_box17_d' => :'Boolean', + :'certify_box17_e' => :'Boolean', + :'certify_box18_a' => :'Boolean', + :'certify_box18_b' => :'Boolean', + :'certify_box18_c' => :'Boolean', + :'certify_box18_d' => :'Boolean', + :'certify_box18_e' => :'Boolean', + :'certify_box18_f' => :'Boolean', + :'certify_box19_a' => :'Boolean', + :'certify_box19_b' => :'Boolean', + :'certify_box19_c' => :'Boolean', + :'certify_box19_d' => :'Boolean', + :'certify_box19_e' => :'Boolean', + :'certify_box19_f' => :'Boolean', + :'certify_box20' => :'Boolean', + :'certify_box21_a' => :'Boolean', + :'certify_box21_b' => :'Boolean', + :'certify_box21_c' => :'Boolean', + :'certify_box21_d' => :'Boolean', + :'certify_box21_e' => :'Boolean', + :'certify_box21_f' => :'Boolean', + :'box23_a_name_sponsoring_entity' => :'String', + :'certify_box23_b' => :'Boolean', + :'certify_box23_c' => :'Boolean', + :'certify_box25' => :'Boolean', + :'box27_a_name_sponsoring_entity' => :'String', + :'certify_box27_b' => :'Boolean', + :'certify_box28' => :'Boolean', + :'certify_box29' => :'Boolean', + :'certify_box30_a' => :'Boolean', + :'certify_box30_b' => :'Boolean', + :'certify_box30_c' => :'Boolean', + :'box32_iga_country' => :'String', + :'box32_iga_type' => :'String', + :'box32_iga_treated_as' => :'String', + :'box32_trustee_or_sponsor' => :'String', + :'box32_trustee_is_foreign' => :'Boolean', + :'certify_box33_a' => :'Boolean', + :'certify_box33_b' => :'Boolean', + :'certify_box33_c' => :'Boolean', + :'certify_box33_d' => :'Boolean', + :'certify_box33_e' => :'Boolean', + :'certify_box33_f' => :'Boolean', + :'box37_a_securities_market' => :'String', + :'box37_b_name_of_entity' => :'String', + :'box37_b_securities_market' => :'String', + :'certify_box40' => :'Boolean', + :'box41_sponsoring_entity' => :'String', + :'certify_box42' => :'Boolean', + :'box35_formed_on_date' => :'Time', + :'box36_filed_on_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'tin_match_status', + :'signature', + :'signed_date', + :'name', + :'business_classification', + :'business_name', + :'business_other', + :'exempt_payee_code', + :'exempt_fatca_code', + :'type_of_tin', + :'tin', + :'address', + :'city', + :'state', + :'zip', + :'account_number', + :'foreign_country_indicator', + :'foreign_address', + :'backup_withholding', + :'e_delivery_consented_at', + :'is1099able', + :'foreign_partner_owner_or_beneficiary', + :'created_at', + :'employee_first_name', + :'employee_middle_name', + :'employee_last_name', + :'employee_name_suffix', + :'box3_marital_status', + :'box4_last_name_differs', + :'box5_num_allowances', + :'other_dependents', + :'non_job_income', + :'deductions', + :'box6_additional_withheld', + :'box7_exempt_from_withholding', + :'office_code', + :'disregarded_entity_chapter4_fatca_status', + :'residence_address', + :'residence_city', + :'residence_state', + :'residence_postal_code', + :'residence_country', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_postal_code', + :'mailing_country', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_postal_code', + :'disregarded_country', + :'foreign_tin', + :'ftin_not_required', + :'reference_number', + :'giin', + :'chapter3_entity_type', + :'chapter4_fatca_status', + :'disregarded_entity', + :'disregarded_entity_giin', + :'benefit_limitation', + :'part4_sponsoring_entity', + :'part4_sponsoring_entity_giin', + :'part7_sponsoring_entity', + :'part12_iga_country', + :'part12_iga_type', + :'part12_fatca_status_under_iga_annex_ii', + :'part12_trustee_name', + :'part12_trustee_is_foreign', + :'part12_model2_iga_giin', + :'box37_a_exchange', + :'box37_b_exchange', + :'box37_b_entity', + :'part28_sponsoring_entity', + :'part28_sponsoring_entity_giin', + :'signer_name', + :'citizenship_country', + :'making_treaty_claim', + :'treaty_country', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'part19_formation_or_resolution_date', + :'part20_filing_date', + :'part21_determination_date', + :'birthday', + :'foreign_tin_not_required', + :'archived', + :'reference_id', + :'company_id', + :'display_name', + :'email', + :'signer_capacity', + :'updated_at', + :'ein', + :'ein_type', + :'box23_a_name_sponsoring_entity', + :'box27_a_name_sponsoring_entity', + :'box32_iga_country', + :'box32_iga_type', + :'box32_iga_treated_as', + :'box32_trustee_or_sponsor', + :'box37_a_securities_market', + :'box37_b_name_of_entity', + :'box37_b_securities_market', + :'box41_sponsoring_entity', + :'box35_formed_on_date', + :'box36_filed_on_date' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'IW9FormDataModelsOneOf' + ] + 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::W9FormDataModel` 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::W9FormDataModel`. 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?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'business_classification') + self.business_classification = attributes[:'business_classification'] + end + + if attributes.key?(:'business_name') + self.business_name = attributes[:'business_name'] + end + + if attributes.key?(:'business_other') + self.business_other = attributes[:'business_other'] + 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?(:'type_of_tin') + self.type_of_tin = attributes[:'type_of_tin'] + 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?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'foreign_country_indicator') + self.foreign_country_indicator = attributes[:'foreign_country_indicator'] + end + + if attributes.key?(:'foreign_address') + self.foreign_address = attributes[:'foreign_address'] + end + + if attributes.key?(:'backup_withholding') + self.backup_withholding = attributes[:'backup_withholding'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'is1099able') + self.is1099able = attributes[:'is1099able'] + 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?(:'created_at') + self.created_at = attributes[:'created_at'] + 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?(:'box3_marital_status') + self.box3_marital_status = attributes[:'box3_marital_status'] + end + + if attributes.key?(:'box4_last_name_differs') + self.box4_last_name_differs = attributes[:'box4_last_name_differs'] + end + + if attributes.key?(:'box5_num_allowances') + self.box5_num_allowances = attributes[:'box5_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?(:'box6_additional_withheld') + self.box6_additional_withheld = attributes[:'box6_additional_withheld'] + end + + if attributes.key?(:'box7_exempt_from_withholding') + self.box7_exempt_from_withholding = attributes[:'box7_exempt_from_withholding'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'disregarded_entity_chapter4_fatca_status') + self.disregarded_entity_chapter4_fatca_status = attributes[:'disregarded_entity_chapter4_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_postal_code') + self.residence_postal_code = attributes[:'residence_postal_code'] + end + + if attributes.key?(:'residence_country') + self.residence_country = attributes[:'residence_country'] + 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_postal_code') + self.mailing_postal_code = attributes[:'mailing_postal_code'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + 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_postal_code') + self.disregarded_postal_code = attributes[:'disregarded_postal_code'] + end + + if attributes.key?(:'disregarded_country') + self.disregarded_country = attributes[:'disregarded_country'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'ftin_not_required') + self.ftin_not_required = attributes[:'ftin_not_required'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'chapter3_entity_type') + self.chapter3_entity_type = attributes[:'chapter3_entity_type'] + end + + if attributes.key?(:'chapter4_fatca_status') + self.chapter4_fatca_status = attributes[:'chapter4_fatca_status'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + end + + if attributes.key?(:'disregarded_entity_giin') + self.disregarded_entity_giin = attributes[:'disregarded_entity_giin'] + end + + if attributes.key?(:'benefit_limitation') + self.benefit_limitation = attributes[:'benefit_limitation'] + end + + if attributes.key?(:'part4_sponsoring_entity') + self.part4_sponsoring_entity = attributes[:'part4_sponsoring_entity'] + end + + if attributes.key?(:'part4_sponsoring_entity_giin') + self.part4_sponsoring_entity_giin = attributes[:'part4_sponsoring_entity_giin'] + end + + if attributes.key?(:'part7_sponsoring_entity') + self.part7_sponsoring_entity = attributes[:'part7_sponsoring_entity'] + end + + if attributes.key?(:'part12_iga_country') + self.part12_iga_country = attributes[:'part12_iga_country'] + end + + if attributes.key?(:'part12_iga_type') + self.part12_iga_type = attributes[:'part12_iga_type'] + end + + if attributes.key?(:'part12_fatca_status_under_iga_annex_ii') + self.part12_fatca_status_under_iga_annex_ii = attributes[:'part12_fatca_status_under_iga_annex_ii'] + end + + if attributes.key?(:'part12_trustee_name') + self.part12_trustee_name = attributes[:'part12_trustee_name'] + end + + if attributes.key?(:'part12_trustee_is_foreign') + self.part12_trustee_is_foreign = attributes[:'part12_trustee_is_foreign'] + end + + if attributes.key?(:'part12_model2_iga_giin') + self.part12_model2_iga_giin = attributes[:'part12_model2_iga_giin'] + end + + if attributes.key?(:'box37_a_exchange') + self.box37_a_exchange = attributes[:'box37_a_exchange'] + end + + if attributes.key?(:'box37_b_exchange') + self.box37_b_exchange = attributes[:'box37_b_exchange'] + end + + if attributes.key?(:'box37_b_entity') + self.box37_b_entity = attributes[:'box37_b_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity') + self.part28_sponsoring_entity = attributes[:'part28_sponsoring_entity'] + end + + if attributes.key?(:'part28_sponsoring_entity_giin') + self.part28_sponsoring_entity_giin = attributes[:'part28_sponsoring_entity_giin'] + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'residence_is_mailing') + self.residence_is_mailing = attributes[:'residence_is_mailing'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + end + + if attributes.key?(:'making_treaty_claim') + self.making_treaty_claim = attributes[:'making_treaty_claim'] + 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?(:'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?(:'certify_box14_a') + self.certify_box14_a = attributes[:'certify_box14_a'] + end + + if attributes.key?(:'certify_box14_b') + self.certify_box14_b = attributes[:'certify_box14_b'] + end + + if attributes.key?(:'certify_box14_c') + self.certify_box14_c = attributes[:'certify_box14_c'] + end + + if attributes.key?(:'certify_box17_1') + self.certify_box17_1 = attributes[:'certify_box17_1'] + end + + if attributes.key?(:'certify_box17_2') + self.certify_box17_2 = attributes[:'certify_box17_2'] + end + + if attributes.key?(:'certify_box18') + self.certify_box18 = attributes[:'certify_box18'] + end + + if attributes.key?(:'certify_box19') + self.certify_box19 = attributes[:'certify_box19'] + end + + if attributes.key?(:'certify_box21') + self.certify_box21 = attributes[:'certify_box21'] + end + + if attributes.key?(:'certify_box22') + self.certify_box22 = attributes[:'certify_box22'] + end + + if attributes.key?(:'certify_box23') + self.certify_box23 = attributes[:'certify_box23'] + end + + if attributes.key?(:'certify_box24_a') + self.certify_box24_a = attributes[:'certify_box24_a'] + end + + if attributes.key?(:'certify_box24_b') + self.certify_box24_b = attributes[:'certify_box24_b'] + end + + if attributes.key?(:'certify_box24_c') + self.certify_box24_c = attributes[:'certify_box24_c'] + end + + if attributes.key?(:'certify_box24_d') + self.certify_box24_d = attributes[:'certify_box24_d'] + end + + if attributes.key?(:'certify_box25_a') + self.certify_box25_a = attributes[:'certify_box25_a'] + end + + if attributes.key?(:'certify_box25_b') + self.certify_box25_b = attributes[:'certify_box25_b'] + end + + if attributes.key?(:'certify_box25_c') + self.certify_box25_c = attributes[:'certify_box25_c'] + end + + if attributes.key?(:'certify_box26') + self.certify_box26 = attributes[:'certify_box26'] + end + + if attributes.key?(:'certify_box27') + self.certify_box27 = attributes[:'certify_box27'] + end + + if attributes.key?(:'certify_box28_a') + self.certify_box28_a = attributes[:'certify_box28_a'] + end + + if attributes.key?(:'certify_box28_b') + self.certify_box28_b = attributes[:'certify_box28_b'] + end + + if attributes.key?(:'certify_box29_a') + self.certify_box29_a = attributes[:'certify_box29_a'] + end + + if attributes.key?(:'certify_box29_b') + self.certify_box29_b = attributes[:'certify_box29_b'] + end + + if attributes.key?(:'certify_box29_c') + self.certify_box29_c = attributes[:'certify_box29_c'] + end + + if attributes.key?(:'certify_box29_d') + self.certify_box29_d = attributes[:'certify_box29_d'] + end + + if attributes.key?(:'certify_box29_e') + self.certify_box29_e = attributes[:'certify_box29_e'] + end + + if attributes.key?(:'certify_box29_f') + self.certify_box29_f = attributes[:'certify_box29_f'] + end + + if attributes.key?(:'certify_box30') + self.certify_box30 = attributes[:'certify_box30'] + end + + if attributes.key?(:'certify_box31') + self.certify_box31 = attributes[:'certify_box31'] + end + + if attributes.key?(:'certify_box32') + self.certify_box32 = attributes[:'certify_box32'] + end + + if attributes.key?(:'certify_box33') + self.certify_box33 = attributes[:'certify_box33'] + end + + if attributes.key?(:'certify_box34') + self.certify_box34 = attributes[:'certify_box34'] + end + + if attributes.key?(:'certify_box35') + self.certify_box35 = attributes[:'certify_box35'] + end + + if attributes.key?(:'certify_box36') + self.certify_box36 = attributes[:'certify_box36'] + end + + if attributes.key?(:'certify_box37_a') + self.certify_box37_a = attributes[:'certify_box37_a'] + end + + if attributes.key?(:'certify_box37_b') + self.certify_box37_b = attributes[:'certify_box37_b'] + end + + if attributes.key?(:'certify_box38') + self.certify_box38 = attributes[:'certify_box38'] + end + + if attributes.key?(:'certify_box39') + self.certify_box39 = attributes[:'certify_box39'] + end + + if attributes.key?(:'certify_box40_a') + self.certify_box40_a = attributes[:'certify_box40_a'] + end + + if attributes.key?(:'certify_box40_b') + self.certify_box40_b = attributes[:'certify_box40_b'] + end + + if attributes.key?(:'certify_box40_c') + self.certify_box40_c = attributes[:'certify_box40_c'] + end + + if attributes.key?(:'certify_box41') + self.certify_box41 = attributes[:'certify_box41'] + end + + if attributes.key?(:'certify_box43') + self.certify_box43 = attributes[:'certify_box43'] + end + + if attributes.key?(:'certify_part29_signature') + self.certify_part29_signature = attributes[:'certify_part29_signature'] + end + + if attributes.key?(:'part19_formation_or_resolution_date') + self.part19_formation_or_resolution_date = attributes[:'part19_formation_or_resolution_date'] + end + + if attributes.key?(:'part20_filing_date') + self.part20_filing_date = attributes[:'part20_filing_date'] + end + + if attributes.key?(:'part21_determination_date') + self.part21_determination_date = attributes[:'part21_determination_date'] + 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?(:'birthday') + self.birthday = attributes[:'birthday'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'signer_capacity') + self.signer_capacity = attributes[:'signer_capacity'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'ein_type') + self.ein_type = attributes[:'ein_type'] + end + + if attributes.key?(:'certify_box14') + self.certify_box14 = attributes[:'certify_box14'] + end + + if attributes.key?(:'certify_box15_a') + self.certify_box15_a = attributes[:'certify_box15_a'] + end + + if attributes.key?(:'certify_box15_b') + self.certify_box15_b = attributes[:'certify_box15_b'] + end + + if attributes.key?(:'certify_box15_c') + self.certify_box15_c = attributes[:'certify_box15_c'] + end + + if attributes.key?(:'certify_box15_d') + self.certify_box15_d = attributes[:'certify_box15_d'] + end + + if attributes.key?(:'certify_box15_e') + self.certify_box15_e = attributes[:'certify_box15_e'] + end + + if attributes.key?(:'certify_box15_f') + self.certify_box15_f = attributes[:'certify_box15_f'] + end + + if attributes.key?(:'certify_box15_g') + self.certify_box15_g = attributes[:'certify_box15_g'] + end + + if attributes.key?(:'certify_box15_h') + self.certify_box15_h = attributes[:'certify_box15_h'] + end + + if attributes.key?(:'certify_box15_i') + self.certify_box15_i = attributes[:'certify_box15_i'] + end + + if attributes.key?(:'certify_box16_a') + self.certify_box16_a = attributes[:'certify_box16_a'] + end + + if attributes.key?(:'box16_b_qdd_corporate') + self.box16_b_qdd_corporate = attributes[:'box16_b_qdd_corporate'] + end + + if attributes.key?(:'box16_b_qdd_partnership') + self.box16_b_qdd_partnership = attributes[:'box16_b_qdd_partnership'] + end + + if attributes.key?(:'box16_b_qdd_disregarded_entity') + self.box16_b_qdd_disregarded_entity = attributes[:'box16_b_qdd_disregarded_entity'] + end + + if attributes.key?(:'certify_box17_a') + self.certify_box17_a = attributes[:'certify_box17_a'] + end + + if attributes.key?(:'certify_box17_b') + self.certify_box17_b = attributes[:'certify_box17_b'] + end + + if attributes.key?(:'certify_box17_c') + self.certify_box17_c = attributes[:'certify_box17_c'] + end + + if attributes.key?(:'certify_box17_d') + self.certify_box17_d = attributes[:'certify_box17_d'] + end + + if attributes.key?(:'certify_box17_e') + self.certify_box17_e = attributes[:'certify_box17_e'] + end + + if attributes.key?(:'certify_box18_a') + self.certify_box18_a = attributes[:'certify_box18_a'] + end + + if attributes.key?(:'certify_box18_b') + self.certify_box18_b = attributes[:'certify_box18_b'] + end + + if attributes.key?(:'certify_box18_c') + self.certify_box18_c = attributes[:'certify_box18_c'] + end + + if attributes.key?(:'certify_box18_d') + self.certify_box18_d = attributes[:'certify_box18_d'] + end + + if attributes.key?(:'certify_box18_e') + self.certify_box18_e = attributes[:'certify_box18_e'] + end + + if attributes.key?(:'certify_box18_f') + self.certify_box18_f = attributes[:'certify_box18_f'] + end + + if attributes.key?(:'certify_box19_a') + self.certify_box19_a = attributes[:'certify_box19_a'] + end + + if attributes.key?(:'certify_box19_b') + self.certify_box19_b = attributes[:'certify_box19_b'] + end + + if attributes.key?(:'certify_box19_c') + self.certify_box19_c = attributes[:'certify_box19_c'] + end + + if attributes.key?(:'certify_box19_d') + self.certify_box19_d = attributes[:'certify_box19_d'] + end + + if attributes.key?(:'certify_box19_e') + self.certify_box19_e = attributes[:'certify_box19_e'] + end + + if attributes.key?(:'certify_box19_f') + self.certify_box19_f = attributes[:'certify_box19_f'] + end + + if attributes.key?(:'certify_box20') + self.certify_box20 = attributes[:'certify_box20'] + end + + if attributes.key?(:'certify_box21_a') + self.certify_box21_a = attributes[:'certify_box21_a'] + end + + if attributes.key?(:'certify_box21_b') + self.certify_box21_b = attributes[:'certify_box21_b'] + end + + if attributes.key?(:'certify_box21_c') + self.certify_box21_c = attributes[:'certify_box21_c'] + end + + if attributes.key?(:'certify_box21_d') + self.certify_box21_d = attributes[:'certify_box21_d'] + end + + if attributes.key?(:'certify_box21_e') + self.certify_box21_e = attributes[:'certify_box21_e'] + end + + if attributes.key?(:'certify_box21_f') + self.certify_box21_f = attributes[:'certify_box21_f'] + end + + if attributes.key?(:'box23_a_name_sponsoring_entity') + self.box23_a_name_sponsoring_entity = attributes[:'box23_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box23_b') + self.certify_box23_b = attributes[:'certify_box23_b'] + end + + if attributes.key?(:'certify_box23_c') + self.certify_box23_c = attributes[:'certify_box23_c'] + end + + if attributes.key?(:'certify_box25') + self.certify_box25 = attributes[:'certify_box25'] + end + + if attributes.key?(:'box27_a_name_sponsoring_entity') + self.box27_a_name_sponsoring_entity = attributes[:'box27_a_name_sponsoring_entity'] + end + + if attributes.key?(:'certify_box27_b') + self.certify_box27_b = attributes[:'certify_box27_b'] + end + + if attributes.key?(:'certify_box28') + self.certify_box28 = attributes[:'certify_box28'] + end + + if attributes.key?(:'certify_box29') + self.certify_box29 = attributes[:'certify_box29'] + end + + if attributes.key?(:'certify_box30_a') + self.certify_box30_a = attributes[:'certify_box30_a'] + end + + if attributes.key?(:'certify_box30_b') + self.certify_box30_b = attributes[:'certify_box30_b'] + end + + if attributes.key?(:'certify_box30_c') + self.certify_box30_c = attributes[:'certify_box30_c'] + end + + if attributes.key?(:'box32_iga_country') + self.box32_iga_country = attributes[:'box32_iga_country'] + end + + if attributes.key?(:'box32_iga_type') + self.box32_iga_type = attributes[:'box32_iga_type'] + end + + if attributes.key?(:'box32_iga_treated_as') + self.box32_iga_treated_as = attributes[:'box32_iga_treated_as'] + end + + if attributes.key?(:'box32_trustee_or_sponsor') + self.box32_trustee_or_sponsor = attributes[:'box32_trustee_or_sponsor'] + end + + if attributes.key?(:'box32_trustee_is_foreign') + self.box32_trustee_is_foreign = attributes[:'box32_trustee_is_foreign'] + end + + if attributes.key?(:'certify_box33_a') + self.certify_box33_a = attributes[:'certify_box33_a'] + end + + if attributes.key?(:'certify_box33_b') + self.certify_box33_b = attributes[:'certify_box33_b'] + end + + if attributes.key?(:'certify_box33_c') + self.certify_box33_c = attributes[:'certify_box33_c'] + end + + if attributes.key?(:'certify_box33_d') + self.certify_box33_d = attributes[:'certify_box33_d'] + end + + if attributes.key?(:'certify_box33_e') + self.certify_box33_e = attributes[:'certify_box33_e'] + end + + if attributes.key?(:'certify_box33_f') + self.certify_box33_f = attributes[:'certify_box33_f'] + end + + if attributes.key?(:'box37_a_securities_market') + self.box37_a_securities_market = attributes[:'box37_a_securities_market'] + end + + if attributes.key?(:'box37_b_name_of_entity') + self.box37_b_name_of_entity = attributes[:'box37_b_name_of_entity'] + end + + if attributes.key?(:'box37_b_securities_market') + self.box37_b_securities_market = attributes[:'box37_b_securities_market'] + end + + if attributes.key?(:'certify_box40') + self.certify_box40 = attributes[:'certify_box40'] + end + + if attributes.key?(:'box41_sponsoring_entity') + self.box41_sponsoring_entity = attributes[:'box41_sponsoring_entity'] + end + + if attributes.key?(:'certify_box42') + self.certify_box42 = attributes[:'certify_box42'] + end + + if attributes.key?(:'box35_formed_on_date') + self.box35_formed_on_date = attributes[:'box35_formed_on_date'] + end + + if attributes.key?(:'box36_filed_on_date') + self.box36_filed_on_date = attributes[:'box36_filed_on_date'] + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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', ["w9", "w4", "w8imy", "w8ben", "w8bene"]) + 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] substantial_us_owners Value to be assigned + def substantial_us_owners=(substantial_us_owners) + if substantial_us_owners.nil? + fail ArgumentError, 'substantial_us_owners cannot be nil' + end + + @substantial_us_owners = substantial_us_owners + 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 && + tin_match_status == o.tin_match_status && + signature == o.signature && + signed_date == o.signed_date && + name == o.name && + business_classification == o.business_classification && + business_name == o.business_name && + business_other == o.business_other && + exempt_payee_code == o.exempt_payee_code && + exempt_fatca_code == o.exempt_fatca_code && + type_of_tin == o.type_of_tin && + tin == o.tin && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + account_number == o.account_number && + foreign_country_indicator == o.foreign_country_indicator && + foreign_address == o.foreign_address && + backup_withholding == o.backup_withholding && + e_delivery_consented_at == o.e_delivery_consented_at && + is1099able == o.is1099able && + foreign_partner_owner_or_beneficiary == o.foreign_partner_owner_or_beneficiary && + created_at == o.created_at && + 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 && + box3_marital_status == o.box3_marital_status && + box4_last_name_differs == o.box4_last_name_differs && + box5_num_allowances == o.box5_num_allowances && + other_dependents == o.other_dependents && + non_job_income == o.non_job_income && + deductions == o.deductions && + box6_additional_withheld == o.box6_additional_withheld && + box7_exempt_from_withholding == o.box7_exempt_from_withholding && + office_code == o.office_code && + disregarded_entity_chapter4_fatca_status == o.disregarded_entity_chapter4_fatca_status && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_postal_code == o.residence_postal_code && + residence_country == o.residence_country && + mailing_address == o.mailing_address && + mailing_city == o.mailing_city && + mailing_state == o.mailing_state && + mailing_postal_code == o.mailing_postal_code && + mailing_country == o.mailing_country && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_postal_code == o.disregarded_postal_code && + disregarded_country == o.disregarded_country && + foreign_tin == o.foreign_tin && + ftin_not_required == o.ftin_not_required && + reference_number == o.reference_number && + giin == o.giin && + chapter3_entity_type == o.chapter3_entity_type && + chapter4_fatca_status == o.chapter4_fatca_status && + disregarded_entity == o.disregarded_entity && + disregarded_entity_giin == o.disregarded_entity_giin && + benefit_limitation == o.benefit_limitation && + part4_sponsoring_entity == o.part4_sponsoring_entity && + part4_sponsoring_entity_giin == o.part4_sponsoring_entity_giin && + part7_sponsoring_entity == o.part7_sponsoring_entity && + part12_iga_country == o.part12_iga_country && + part12_iga_type == o.part12_iga_type && + part12_fatca_status_under_iga_annex_ii == o.part12_fatca_status_under_iga_annex_ii && + part12_trustee_name == o.part12_trustee_name && + part12_trustee_is_foreign == o.part12_trustee_is_foreign && + part12_model2_iga_giin == o.part12_model2_iga_giin && + box37_a_exchange == o.box37_a_exchange && + box37_b_exchange == o.box37_b_exchange && + box37_b_entity == o.box37_b_entity && + part28_sponsoring_entity == o.part28_sponsoring_entity && + part28_sponsoring_entity_giin == o.part28_sponsoring_entity_giin && + signer_name == o.signer_name && + residence_is_mailing == o.residence_is_mailing && + citizenship_country == o.citizenship_country && + making_treaty_claim == o.making_treaty_claim && + treaty_country == o.treaty_country && + treaty_article == o.treaty_article && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + treaty_reasons == o.treaty_reasons && + certify_box14_a == o.certify_box14_a && + certify_box14_b == o.certify_box14_b && + certify_box14_c == o.certify_box14_c && + certify_box17_1 == o.certify_box17_1 && + certify_box17_2 == o.certify_box17_2 && + certify_box18 == o.certify_box18 && + certify_box19 == o.certify_box19 && + certify_box21 == o.certify_box21 && + certify_box22 == o.certify_box22 && + certify_box23 == o.certify_box23 && + certify_box24_a == o.certify_box24_a && + certify_box24_b == o.certify_box24_b && + certify_box24_c == o.certify_box24_c && + certify_box24_d == o.certify_box24_d && + certify_box25_a == o.certify_box25_a && + certify_box25_b == o.certify_box25_b && + certify_box25_c == o.certify_box25_c && + certify_box26 == o.certify_box26 && + certify_box27 == o.certify_box27 && + certify_box28_a == o.certify_box28_a && + certify_box28_b == o.certify_box28_b && + certify_box29_a == o.certify_box29_a && + certify_box29_b == o.certify_box29_b && + certify_box29_c == o.certify_box29_c && + certify_box29_d == o.certify_box29_d && + certify_box29_e == o.certify_box29_e && + certify_box29_f == o.certify_box29_f && + certify_box30 == o.certify_box30 && + certify_box31 == o.certify_box31 && + certify_box32 == o.certify_box32 && + certify_box33 == o.certify_box33 && + certify_box34 == o.certify_box34 && + certify_box35 == o.certify_box35 && + certify_box36 == o.certify_box36 && + certify_box37_a == o.certify_box37_a && + certify_box37_b == o.certify_box37_b && + certify_box38 == o.certify_box38 && + certify_box39 == o.certify_box39 && + certify_box40_a == o.certify_box40_a && + certify_box40_b == o.certify_box40_b && + certify_box40_c == o.certify_box40_c && + certify_box41 == o.certify_box41 && + certify_box43 == o.certify_box43 && + certify_part29_signature == o.certify_part29_signature && + part19_formation_or_resolution_date == o.part19_formation_or_resolution_date && + part20_filing_date == o.part20_filing_date && + part21_determination_date == o.part21_determination_date && + substantial_us_owners == o.substantial_us_owners && + birthday == o.birthday && + foreign_tin_not_required == o.foreign_tin_not_required && + archived == o.archived && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + signer_capacity == o.signer_capacity && + updated_at == o.updated_at && + ein == o.ein && + ein_type == o.ein_type && + certify_box14 == o.certify_box14 && + certify_box15_a == o.certify_box15_a && + certify_box15_b == o.certify_box15_b && + certify_box15_c == o.certify_box15_c && + certify_box15_d == o.certify_box15_d && + certify_box15_e == o.certify_box15_e && + certify_box15_f == o.certify_box15_f && + certify_box15_g == o.certify_box15_g && + certify_box15_h == o.certify_box15_h && + certify_box15_i == o.certify_box15_i && + certify_box16_a == o.certify_box16_a && + box16_b_qdd_corporate == o.box16_b_qdd_corporate && + box16_b_qdd_partnership == o.box16_b_qdd_partnership && + box16_b_qdd_disregarded_entity == o.box16_b_qdd_disregarded_entity && + certify_box17_a == o.certify_box17_a && + certify_box17_b == o.certify_box17_b && + certify_box17_c == o.certify_box17_c && + certify_box17_d == o.certify_box17_d && + certify_box17_e == o.certify_box17_e && + certify_box18_a == o.certify_box18_a && + certify_box18_b == o.certify_box18_b && + certify_box18_c == o.certify_box18_c && + certify_box18_d == o.certify_box18_d && + certify_box18_e == o.certify_box18_e && + certify_box18_f == o.certify_box18_f && + certify_box19_a == o.certify_box19_a && + certify_box19_b == o.certify_box19_b && + certify_box19_c == o.certify_box19_c && + certify_box19_d == o.certify_box19_d && + certify_box19_e == o.certify_box19_e && + certify_box19_f == o.certify_box19_f && + certify_box20 == o.certify_box20 && + certify_box21_a == o.certify_box21_a && + certify_box21_b == o.certify_box21_b && + certify_box21_c == o.certify_box21_c && + certify_box21_d == o.certify_box21_d && + certify_box21_e == o.certify_box21_e && + certify_box21_f == o.certify_box21_f && + box23_a_name_sponsoring_entity == o.box23_a_name_sponsoring_entity && + certify_box23_b == o.certify_box23_b && + certify_box23_c == o.certify_box23_c && + certify_box25 == o.certify_box25 && + box27_a_name_sponsoring_entity == o.box27_a_name_sponsoring_entity && + certify_box27_b == o.certify_box27_b && + certify_box28 == o.certify_box28 && + certify_box29 == o.certify_box29 && + certify_box30_a == o.certify_box30_a && + certify_box30_b == o.certify_box30_b && + certify_box30_c == o.certify_box30_c && + box32_iga_country == o.box32_iga_country && + box32_iga_type == o.box32_iga_type && + box32_iga_treated_as == o.box32_iga_treated_as && + box32_trustee_or_sponsor == o.box32_trustee_or_sponsor && + box32_trustee_is_foreign == o.box32_trustee_is_foreign && + certify_box33_a == o.certify_box33_a && + certify_box33_b == o.certify_box33_b && + certify_box33_c == o.certify_box33_c && + certify_box33_d == o.certify_box33_d && + certify_box33_e == o.certify_box33_e && + certify_box33_f == o.certify_box33_f && + box37_a_securities_market == o.box37_a_securities_market && + box37_b_name_of_entity == o.box37_b_name_of_entity && + box37_b_securities_market == o.box37_b_securities_market && + certify_box40 == o.certify_box40 && + box41_sponsoring_entity == o.box41_sponsoring_entity && + certify_box42 == o.certify_box42 && + box35_formed_on_date == o.box35_formed_on_date && + box36_filed_on_date == o.box36_filed_on_date + 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, tin_match_status, signature, signed_date, name, business_classification, business_name, business_other, exempt_payee_code, exempt_fatca_code, type_of_tin, tin, address, city, state, zip, account_number, foreign_country_indicator, foreign_address, backup_withholding, e_delivery_consented_at, is1099able, foreign_partner_owner_or_beneficiary, created_at, employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, box3_marital_status, box4_last_name_differs, box5_num_allowances, other_dependents, non_job_income, deductions, box6_additional_withheld, box7_exempt_from_withholding, office_code, disregarded_entity_chapter4_fatca_status, residence_address, residence_city, residence_state, residence_postal_code, residence_country, mailing_address, mailing_city, mailing_state, mailing_postal_code, mailing_country, disregarded_address, disregarded_city, disregarded_state, disregarded_postal_code, disregarded_country, foreign_tin, ftin_not_required, reference_number, giin, chapter3_entity_type, chapter4_fatca_status, disregarded_entity, disregarded_entity_giin, benefit_limitation, part4_sponsoring_entity, part4_sponsoring_entity_giin, part7_sponsoring_entity, part12_iga_country, part12_iga_type, part12_fatca_status_under_iga_annex_ii, part12_trustee_name, part12_trustee_is_foreign, part12_model2_iga_giin, box37_a_exchange, box37_b_exchange, box37_b_entity, part28_sponsoring_entity, part28_sponsoring_entity_giin, signer_name, residence_is_mailing, citizenship_country, making_treaty_claim, treaty_country, treaty_article, withholding_rate, income_type, treaty_reasons, certify_box14_a, certify_box14_b, certify_box14_c, certify_box17_1, certify_box17_2, certify_box18, certify_box19, certify_box21, certify_box22, certify_box23, certify_box24_a, certify_box24_b, certify_box24_c, certify_box24_d, certify_box25_a, certify_box25_b, certify_box25_c, certify_box26, certify_box27, certify_box28_a, certify_box28_b, certify_box29_a, certify_box29_b, certify_box29_c, certify_box29_d, certify_box29_e, certify_box29_f, certify_box30, certify_box31, certify_box32, certify_box33, certify_box34, certify_box35, certify_box36, certify_box37_a, certify_box37_b, certify_box38, certify_box39, certify_box40_a, certify_box40_b, certify_box40_c, certify_box41, certify_box43, certify_part29_signature, part19_formation_or_resolution_date, part20_filing_date, part21_determination_date, substantial_us_owners, birthday, foreign_tin_not_required, archived, reference_id, company_id, display_name, email, signer_capacity, updated_at, ein, ein_type, certify_box14, certify_box15_a, certify_box15_b, certify_box15_c, certify_box15_d, certify_box15_e, certify_box15_f, certify_box15_g, certify_box15_h, certify_box15_i, certify_box16_a, box16_b_qdd_corporate, box16_b_qdd_partnership, box16_b_qdd_disregarded_entity, certify_box17_a, certify_box17_b, certify_box17_c, certify_box17_d, certify_box17_e, certify_box18_a, certify_box18_b, certify_box18_c, certify_box18_d, certify_box18_e, certify_box18_f, certify_box19_a, certify_box19_b, certify_box19_c, certify_box19_d, certify_box19_e, certify_box19_f, certify_box20, certify_box21_a, certify_box21_b, certify_box21_c, certify_box21_d, certify_box21_e, certify_box21_f, box23_a_name_sponsoring_entity, certify_box23_b, certify_box23_c, certify_box25, box27_a_name_sponsoring_entity, certify_box27_b, certify_box28, certify_box29, certify_box30_a, certify_box30_b, certify_box30_c, box32_iga_country, box32_iga_type, box32_iga_treated_as, box32_trustee_or_sponsor, box32_trustee_is_foreign, certify_box33_a, certify_box33_b, certify_box33_c, certify_box33_d, certify_box33_e, certify_box33_f, box37_a_securities_market, box37_b_name_of_entity, box37_b_securities_market, certify_box40, box41_sponsoring_entity, certify_box42, box35_formed_on_date, box36_filed_on_date].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 new file mode 100644 index 0000000..0d5dcd4 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb @@ -0,0 +1,542 @@ +=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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W9FormResponse + # 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 unique identifier for the form. + attr_accessor :id + + # The form type. + attr_accessor :type + + # The form status. + attr_accessor :entry_status + + # The timestamp for the latest status update. + attr_accessor :entry_status_date + + # A reference identifier for the form. + attr_accessor :reference_id + + # The ID of the associated company. + attr_accessor :company_id + + # The display name associated with the form. + attr_accessor :display_name + + # The email address of the individual associated with the form. + attr_accessor :email + + # Indicates whether the form is archived. + attr_accessor :archived + + # The signature of the form. + attr_accessor :signature + + # The date the form was signed. + attr_accessor :signed_date + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The creation date of the form. + attr_accessor :created_at + + # The last updated date of the form. + attr_accessor :updated_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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', + :'id' => :'id', + :'type' => :'type', + :'entry_status' => :'entryStatus', + :'entry_status_date' => :'entryStatusDate', + :'reference_id' => :'referenceId', + :'company_id' => :'companyId', + :'display_name' => :'displayName', + :'email' => :'email', + :'archived' => :'archived', + :'signature' => :'signature', + :'signed_date' => :'signedDate', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt' + } + 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', + :'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', + :'id' => :'String', + :'type' => :'String', + :'entry_status' => :'String', + :'entry_status_date' => :'Time', + :'reference_id' => :'String', + :'company_id' => :'String', + :'display_name' => :'String', + :'email' => :'String', + :'archived' => :'Boolean', + :'signature' => :'String', + :'signed_date' => :'Time', + :'e_delivery_consented_at' => :'Time', + :'created_at' => :'Time', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + 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', + :'account_number', + :'entry_status_date', + :'reference_id', + :'email', + :'signature', + :'signed_date', + :'e_delivery_consented_at', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseResponse' + ] + 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::W9FormResponse` 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::W9FormResponse`. 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?(:'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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'entry_status') + self.entry_status = attributes[:'entry_status'] + end + + if attributes.key?(:'entry_status_date') + self.entry_status_date = attributes[:'entry_status_date'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'archived') + self.archived = attributes[:'archived'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + + if attributes.key?(:'signed_date') + self.signed_date = attributes[:'signed_date'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + 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 + 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 && + 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 && + id == o.id && + type == o.type && + entry_status == o.entry_status && + entry_status_date == o.entry_status_date && + reference_id == o.reference_id && + company_id == o.company_id && + display_name == o.display_name && + email == o.email && + archived == o.archived && + signature == o.signature && + signed_date == o.signed_date && + e_delivery_consented_at == o.e_delivery_consented_at && + created_at == o.created_at && + updated_at == o.updated_at + 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, 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, id, type, entry_status, entry_status_date, reference_id, company_id, display_name, email, archived, signature, signed_date, e_delivery_consented_at, created_at, updated_at].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/EInvoicing/V1/bad_download_request.rb b/lib/avalara_sdk/models/EInvoicing/V1/bad_download_request.rb index 99b2f71..5ee147e 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/bad_download_request.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/bad_download_request.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns an HTTP status code and message for a 'bad request' class BadDownloadRequest # The three-digit HTTP error code for the bad request @@ -229,6 +228,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/bad_request.rb b/lib/avalara_sdk/models/EInvoicing/V1/bad_request.rb index a6df820..b913f82 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/bad_request.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/bad_request.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns an HTTP status code and message for a 'bad request' class BadRequest # The three-digit HTTP error code for the bad request @@ -219,6 +218,5 @@ def _to_hash(value) end 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 2da95e4..a379e53 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb @@ -1,17 +1,17 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 - class BatchSearch + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Provides details about a batch search operation, including status, timestamps, and potential errors. + class BatchSearch # ID of the batch search attr_accessor :id @@ -301,6 +301,5 @@ def _to_hash(value) end end - - end -end + +end 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 c060d2c..29d6a7d 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 @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Schema for batch search list class BatchSearchListResponse # The count of records in the result set @@ -230,6 +229,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/batch_search_participants202_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/batch_search_participants202_response.rb new file mode 100644 index 0000000..a3ba2b2 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/batch_search_participants202_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 BatchSearchParticipants202Response + # The unique ID of the batch search. + attr_accessor :id + + # Status of the batch search. + attr_accessor :status + + # A message indicating that the batch search request has been accepted. + 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::BatchSearchParticipants202Response` 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::BatchSearchParticipants202Response`. 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/conditional_for_field.rb b/lib/avalara_sdk/models/EInvoicing/V1/conditional_for_field.rb index 22cba18..6a92f3f 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/conditional_for_field.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/conditional_for_field.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Mandates for which this field is conditional class ConditionalForField attr_accessor :country_mandate @@ -220,6 +219,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field.rb b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field.rb index cc8fd9f..83ca9e9 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # The Data Input Field class DataInputField # Field UUID @@ -348,6 +347,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_not_used_for.rb b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_not_used_for.rb index 5a55cbb..1fb6f04 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_not_used_for.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_not_used_for.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Array of CountryMandate names for which this field is not used. class DataInputFieldNotUsedFor attr_accessor :country_mandate @@ -208,6 +207,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_optional_for.rb b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_optional_for.rb index 7628006..67e19fa 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_optional_for.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_optional_for.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Array of CountryMandate names for which this field is optional. class DataInputFieldOptionalFor attr_accessor :country_mandate @@ -208,6 +207,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_required_for.rb b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_required_for.rb index 4c40be3..245d050 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_required_for.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/data_input_field_required_for.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Array of CountryMandate names for which this field is required. class DataInputFieldRequiredFor attr_accessor :country_mandate @@ -208,6 +207,5 @@ def _to_hash(value) end 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 9683f8e..49edd2e 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 @@ -1,17 +1,17 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 - class DataInputFieldsResponse + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Response model providing a list of input fields required, optional, or conditional for different country mandates. + class DataInputFieldsResponse # Total count of results attr_accessor :recordset_count @@ -230,6 +230,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response.rb index d8333af..2a52faf 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Response schema for directory search results class DirectorySearchResponse # The count of records in the result set @@ -230,6 +229,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner.rb b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner.rb index 395195d..386afad 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class DirectorySearchResponseValueInner # Avalara unique ID of the participant in the directory. attr_accessor :id @@ -271,6 +270,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_addresses_inner.rb b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_addresses_inner.rb index a80054e..cb9ad2f 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_addresses_inner.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_addresses_inner.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class DirectorySearchResponseValueInnerAddressesInner # Address line 1 attr_accessor :line1 @@ -248,6 +247,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_identifiers_inner.rb b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_identifiers_inner.rb index 5d9b193..fe0fbab 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_identifiers_inner.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_identifiers_inner.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class DirectorySearchResponseValueInnerIdentifiersInner # Peppol Participant ID if the participant is in Peppol network attr_accessor :name @@ -218,6 +217,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_supported_document_types_inner.rb b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_supported_document_types_inner.rb index 0a3b50e..07c0f68 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_supported_document_types_inner.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/directory_search_response_value_inner_supported_document_types_inner.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class DirectorySearchResponseValueInnerSupportedDocumentTypesInner # Document type name. attr_accessor :name @@ -238,6 +237,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb index 9ff5047..2b520d5 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb @@ -1,17 +1,17 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 - class DocumentFetch + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # An object of the inbound document + 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 @@ -228,6 +228,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_list_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_list_response.rb index 4a1fb9f..89a0891 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_list_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_list_response.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns the requested list of documents class DocumentListResponse # Count of collections for the given date range @@ -238,6 +237,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_status_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_status_response.rb index e16dc72..73673b3 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_status_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_status_response.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns the current document ID and status class DocumentStatusResponse # The unique ID for this document @@ -230,6 +229,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_submission_error.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_submission_error.rb index 2df580d..abd93ba 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_submission_error.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_submission_error.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns an HTTP status code and message for an 'exception' class DocumentSubmissionError # The three-digit HTTP status code for the exception @@ -219,6 +218,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_submit_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_submit_response.rb index 5fbdc88..14294ad 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_submit_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_submit_response.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns the unique ID of a successful document submission class DocumentSubmitResponse # 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. @@ -209,6 +208,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_summary.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_summary.rb index 8210813..0bb4209 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_summary.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_summary.rb @@ -1,21 +1,23 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Displays a summary of information about the document class DocumentSummary # The unique ID for this document attr_accessor :id + # Unique identifier that represents the company within the system. + attr_accessor :company_id + # The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss attr_accessor :process_date_time @@ -59,6 +61,7 @@ class DocumentSummary def self.attribute_map { :'id' => :'id', + :'company_id' => :'companyId', :'process_date_time' => :'processDateTime', :'status' => :'status', :'supplier_name' => :'supplierName', @@ -84,6 +87,7 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', + :'company_id' => :'String', :'process_date_time' => :'String', :'status' => :'String', :'supplier_name' => :'String', @@ -125,6 +129,10 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + if attributes.key?(:'process_date_time') self.process_date_time = attributes[:'process_date_time'] end @@ -199,6 +207,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && + company_id == o.company_id && process_date_time == o.process_date_time && status == o.status && supplier_name == o.supplier_name && @@ -223,7 +232,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, process_date_time, status, supplier_name, customer_name, document_type, document_version, document_number, document_date, flow, country_code, country_mandate, interface, receiver].hash + [id, company_id, process_date_time, status, supplier_name, customer_name, document_type, document_version, document_number, document_date, flow, country_code, country_mandate, interface, receiver].hash end # Builds the object from hash @@ -339,6 +348,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb index c0af563..5105d0d 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb @@ -1,17 +1,17 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 - class ErrorResponse + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Structure for reporting errors encountered during API operations, including title, status, and detailed message. + class ErrorResponse attr_accessor :title attr_accessor :status @@ -234,6 +234,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/event_id.rb b/lib/avalara_sdk/models/EInvoicing/V1/event_id.rb new file mode 100644 index 0000000..272fc96 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/event_id.rb @@ -0,0 +1,218 @@ +=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 EventId + # Unique, to the delivery system, identifier of the event. + attr_accessor :event_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_name' => :'eventName' + } + 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 + { + :'event_name' => :'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::EventId` 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::EventId`. 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?(:'event_name') + self.event_name = attributes[:'event_name'] + else + self.event_name = 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 @event_name.nil? + invalid_properties.push('invalid value for "event_name", event_name 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 @event_name.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 && + event_name == o.event_name + 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 + [event_name].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/event_message.rb b/lib/avalara_sdk/models/EInvoicing/V1/event_message.rb new file mode 100644 index 0000000..011430f --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/event_message.rb @@ -0,0 +1,322 @@ +=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 EventMessage + # Event-specific information + attr_accessor :message + + attr_accessor :signature + + # Tenant ID of the event + attr_accessor :tenant_id + + # The correlation ID used by Avalara to aid in tracing through to provenance of this event massage. + attr_accessor :correlation_id + + # The Avalara registered code for the system. See Taxonomy: Avalara Systems + attr_accessor :system_code + + # Type of the event + attr_accessor :event_name + + # Version of the included payload. + attr_accessor :event_version + + # Timestamp when the event was received by the dispatch service. + attr_accessor :receipt_timestamp + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message', + :'signature' => :'signature', + :'tenant_id' => :'tenantId', + :'correlation_id' => :'correlationId', + :'system_code' => :'systemCode', + :'event_name' => :'eventName', + :'event_version' => :'eventVersion', + :'receipt_timestamp' => :'receiptTimestamp' + } + 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 + { + :'message' => :'Object', + :'signature' => :'SignatureValueSignature', + :'tenant_id' => :'String', + :'correlation_id' => :'String', + :'system_code' => :'String', + :'event_name' => :'String', + :'event_version' => :'String', + :'receipt_timestamp' => :'Time' + } + 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 + [ + :'EventPayload' + ] + 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::EventMessage` 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::EventMessage`. 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?(:'message') + self.message = attributes[:'message'] + else + self.message = nil + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + else + self.signature = nil + end + + if attributes.key?(:'tenant_id') + self.tenant_id = attributes[:'tenant_id'] + else + self.tenant_id = nil + end + + if attributes.key?(:'correlation_id') + self.correlation_id = attributes[:'correlation_id'] + end + + if attributes.key?(:'system_code') + self.system_code = attributes[:'system_code'] + else + self.system_code = nil + end + + if attributes.key?(:'event_name') + self.event_name = attributes[:'event_name'] + else + self.event_name = nil + end + + if attributes.key?(:'event_version') + self.event_version = attributes[:'event_version'] + end + + if attributes.key?(:'receipt_timestamp') + self.receipt_timestamp = attributes[:'receipt_timestamp'] + 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 @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @signature.nil? + invalid_properties.push('invalid value for "signature", signature cannot be nil.') + end + + if @tenant_id.nil? + invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.') + end + + if @system_code.nil? + invalid_properties.push('invalid value for "system_code", system_code cannot be nil.') + end + + if @event_name.nil? + invalid_properties.push('invalid value for "event_name", event_name 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 @message.nil? + return false if @signature.nil? + return false if @tenant_id.nil? + return false if @system_code.nil? + return false if @event_name.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 && + message == o.message && + signature == o.signature && + tenant_id == o.tenant_id && + correlation_id == o.correlation_id && + system_code == o.system_code && + event_name == o.event_name && + event_version == o.event_version && + receipt_timestamp == o.receipt_timestamp + 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 + [message, signature, tenant_id, correlation_id, system_code, event_name, event_version, receipt_timestamp].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/event_payload.rb b/lib/avalara_sdk/models/EInvoicing/V1/event_payload.rb new file mode 100644 index 0000000..8371fa8 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/event_payload.rb @@ -0,0 +1,241 @@ +=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 EventPayload + attr_accessor :signature + + # Event-specific information + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'signature' => :'signature', + :'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 + { + :'signature' => :'SignatureValueSignature', + :'message' => :'Object' + } + 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 + [ + :'SignatureValue' + ] + 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::EventPayload` 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::EventPayload`. 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?(:'signature') + self.signature = attributes[:'signature'] + else + self.signature = nil + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + else + self.message = 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 @signature.nil? + invalid_properties.push('invalid value for "signature", signature cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message 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 @signature.nil? + return false if @message.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 && + signature == o.signature && + 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 + [signature, 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/event_subscription.rb b/lib/avalara_sdk/models/EInvoicing/V1/event_subscription.rb new file mode 100644 index 0000000..c91d3c6 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/event_subscription.rb @@ -0,0 +1,225 @@ +=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 EventSubscription + # Unique, to the delivery system, identifier of the event. + attr_accessor :event_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event_name' => :'eventName' + } + 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 + { + :'event_name' => :'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 + [ + :'EventId' + ] + 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::EventSubscription` 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::EventSubscription`. 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?(:'event_name') + self.event_name = attributes[:'event_name'] + else + self.event_name = 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 @event_name.nil? + invalid_properties.push('invalid value for "event_name", event_name 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 @event_name.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 && + event_name == o.event_name + 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 + [event_name].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/fetch_documents_request.rb b/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request.rb index c6b28f1..2386db7 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request.rb @@ -1,18 +1,15 @@ -=begin +=begin #Avalara E-Invoicing API #An API that supports sending data for an E-Invoicing compliance use-case. -SDK Version : - - -=end - -require 'date' -require 'time' - -module AvalaraSdk::EInvoicing - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class FetchDocumentsRequest # Array of key-value pairs used to retrieve inbound documents from the Tax Authority attr_accessor :data @@ -221,6 +218,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_data_inner.rb b/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_data_inner.rb index 8ae4588..88492e3 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_data_inner.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_data_inner.rb @@ -1,18 +1,15 @@ -=begin +=begin #Avalara E-Invoicing API #An API that supports sending data for an E-Invoicing compliance use-case. -SDK Version : - - -=end - -require 'date' -require 'time' - -module AvalaraSdk::EInvoicing - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class FetchDocumentsRequestDataInner # Descriptor of the identifier attr_accessor :key @@ -234,6 +231,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_metadata.rb b/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_metadata.rb index b57bea6..d0c1aa1 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_metadata.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/fetch_documents_request_metadata.rb @@ -1,18 +1,15 @@ -=begin +=begin #Avalara E-Invoicing API #An API that supports sending data for an E-Invoicing compliance use-case. -SDK Version : - - -=end - -require 'date' -require 'time' - -module AvalaraSdk::EInvoicing - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class FetchDocumentsRequestMetadata # Specifies a unique ID for this workflow. attr_accessor :workflow_id @@ -23,6 +20,12 @@ class FetchDocumentsRequestMetadata # Specifies the data format version number attr_accessor :data_format_version + # Specifies the format of the output document to be generated for the recipient. This format should be chosen based on the recipient's preferences or requirements as defined by applicable e-invoicing regulations. When not specified for mandates that don't require a specific output format, the system will use the default format defined for that mandate. + attr_accessor :output_data_format + + # Specifies the version of the selected output document format + attr_accessor :output_data_format_version + # The two-letter ISO-3166 country code for the country for which document is being retrieved attr_accessor :country_code @@ -35,6 +38,8 @@ def self.attribute_map :'workflow_id' => :'workflowId', :'data_format' => :'dataFormat', :'data_format_version' => :'dataFormatVersion', + :'output_data_format' => :'outputDataFormat', + :'output_data_format_version' => :'outputDataFormatVersion', :'country_code' => :'countryCode', :'country_mandate' => :'countryMandate' } @@ -51,6 +56,8 @@ def self.openapi_types :'workflow_id' => :'String', :'data_format' => :'String', :'data_format_version' => :'Float', + :'output_data_format' => :'String', + :'output_data_format_version' => :'Float', :'country_code' => :'String', :'country_mandate' => :'String' } @@ -95,6 +102,18 @@ def initialize(attributes = {}) self.data_format_version = nil end + if attributes.key?(:'output_data_format') + self.output_data_format = attributes[:'output_data_format'] + else + self.output_data_format = nil + end + + if attributes.key?(:'output_data_format_version') + self.output_data_format_version = attributes[:'output_data_format_version'] + else + self.output_data_format_version = nil + end + if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] else @@ -125,6 +144,14 @@ def list_invalid_properties invalid_properties.push('invalid value for "data_format_version", data_format_version cannot be nil.') end + if @output_data_format.nil? + invalid_properties.push('invalid value for "output_data_format", output_data_format cannot be nil.') + end + + if @output_data_format_version.nil? + invalid_properties.push('invalid value for "output_data_format_version", output_data_format_version cannot be nil.') + end + if @country_code.nil? invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') end @@ -143,6 +170,8 @@ def valid? return false if @workflow_id.nil? return false if @data_format.nil? return false if @data_format_version.nil? + return false if @output_data_format.nil? + return false if @output_data_format_version.nil? return false if @country_code.nil? return false if @country_mandate.nil? true @@ -156,6 +185,8 @@ def ==(o) workflow_id == o.workflow_id && data_format == o.data_format && data_format_version == o.data_format_version && + output_data_format == o.output_data_format && + output_data_format_version == o.output_data_format_version && country_code == o.country_code && country_mandate == o.country_mandate end @@ -169,7 +200,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [workflow_id, data_format, data_format_version, country_code, country_mandate].hash + [workflow_id, data_format, data_format_version, output_data_format, output_data_format_version, country_code, country_mandate].hash end # Builds the object from hash @@ -285,6 +316,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/forbidden_error.rb b/lib/avalara_sdk/models/EInvoicing/V1/forbidden_error.rb index ecf21fc..7564fa9 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/forbidden_error.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/forbidden_error.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns an optional message with a 'forbidden' response class ForbiddenError # A message that informs the user that they may not access a resource @@ -209,6 +208,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature.rb b/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature.rb new file mode 100644 index 0000000..489f1dd --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature.rb @@ -0,0 +1,270 @@ +=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 + # Basic signature utilizing a shared key. + class HmacSignature + # HMAC key for authentication + attr_accessor :key + + # HMAC algorithm for authentication + attr_accessor :algorithm + + 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 + { + :'key' => :'key', + :'algorithm' => :'algorithm' + } + 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', + :'algorithm' => :'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::HmacSignature` 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::HmacSignature`. 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + else + self.algorithm = 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 @algorithm.nil? + invalid_properties.push('invalid value for "algorithm", algorithm 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 @algorithm.nil? + algorithm_validator = EnumAttributeValidator.new('String', ["sha256", "sha384", "sha512"]) + return false unless algorithm_validator.valid?(@algorithm) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] algorithm Object to be assigned + def algorithm=(algorithm) + validator = EnumAttributeValidator.new('String', ["sha256", "sha384", "sha512"]) + unless validator.valid?(algorithm) + fail ArgumentError, "invalid value for \"algorithm\", must be one of #{validator.allowable_values}." + end + @algorithm = algorithm + 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 && + algorithm == o.algorithm + 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, algorithm].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 new file mode 100644 index 0000000..5312997 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb @@ -0,0 +1,270 @@ +=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 + # Contains the HMAC algorithm and the resulting signature value used for verifying message integrity. + class HmacSignatureValue + # The algorithm used to create the signature. + attr_accessor :algorithm + + # Signature of the message. + attr_accessor :value + + 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 + { + :'algorithm' => :'algorithm', + :'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 + { + :'algorithm' => :'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::HmacSignatureValue` 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::HmacSignatureValue`. 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + else + self.algorithm = nil + 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 @algorithm.nil? + invalid_properties.push('invalid value for "algorithm", algorithm cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value 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 @algorithm.nil? + algorithm_validator = EnumAttributeValidator.new('String', ["sha256"]) + return false unless algorithm_validator.valid?(@algorithm) + return false if @value.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] algorithm Object to be assigned + def algorithm=(algorithm) + validator = EnumAttributeValidator.new('String', ["sha256"]) + unless validator.valid?(algorithm) + fail ArgumentError, "invalid value for \"algorithm\", must be one of #{validator.allowable_values}." + end + @algorithm = algorithm + 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 && + algorithm == o.algorithm && + 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 + [algorithm, 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/id.rb b/lib/avalara_sdk/models/EInvoicing/V1/id.rb new file mode 100644 index 0000000..f957684 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/id.rb @@ -0,0 +1,219 @@ +=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 + # Common ID format. + class Id + # Unique identifier of this specific resource. + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + 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' + } + 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::Id` 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::Id`. 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 + 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 + + 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? + 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 + 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].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/input_data_formats.rb b/lib/avalara_sdk/models/EInvoicing/V1/input_data_formats.rb index 68de212..789f8ed 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/input_data_formats.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/input_data_formats.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Format and version used when inputting the data class InputDataFormats # Document format @@ -220,6 +219,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/internal_server_error.rb b/lib/avalara_sdk/models/EInvoicing/V1/internal_server_error.rb index 9409780..53522be 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/internal_server_error.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/internal_server_error.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns an optional message with a 'InternalServerError' response class InternalServerError # A bad request error code @@ -219,6 +218,5 @@ def _to_hash(value) end 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 d9fcc01..f126f4c 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb @@ -1,17 +1,17 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 - class Mandate + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # An object representing the country 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 @@ -24,15 +24,30 @@ class Mandate # Mandate description attr_accessor :description - # Indicates whether this mandate supported by the partner API - attr_accessor :supported_by_partner_api + # Indicates whether this mandate supported by the ELR API + attr_accessor :supported_by_elrapi # Mandate format attr_accessor :mandate_format + # The type of e-invoicing flow for this mandate + attr_accessor :e_invoicing_flow + + # Link to the documentation for this mandate's e-invoicing flow + attr_accessor :e_invoicing_flow_documentation_link + + # List of available media types for downloading invoices for this mandate + attr_accessor :get_invoice_available_media_type + + # Indicates whether this mandate supports inbound digital documents + attr_accessor :supports_inbound_digital_document + # Format and version used when inputting the data attr_accessor :input_data_formats + # Lists the supported output document formats for the country mandate. For countries where specifying an output document format is required (e.g., France), this array will contain the applicable formats. For other countries where output format selection is not necessary, the array will be empty. + attr_accessor :output_data_formats + # Workflow ID list attr_accessor :workflow_ids @@ -43,9 +58,14 @@ def self.attribute_map :'country_mandate' => :'countryMandate', :'country_code' => :'countryCode', :'description' => :'description', - :'supported_by_partner_api' => :'supportedByPartnerAPI', + :'supported_by_elrapi' => :'supportedByELRAPI', :'mandate_format' => :'mandateFormat', + :'e_invoicing_flow' => :'eInvoicingFlow', + :'e_invoicing_flow_documentation_link' => :'eInvoicingFlowDocumentationLink', + :'get_invoice_available_media_type' => :'getInvoiceAvailableMediaType', + :'supports_inbound_digital_document' => :'supportsInboundDigitalDocument', :'input_data_formats' => :'inputDataFormats', + :'output_data_formats' => :'outputDataFormats', :'workflow_ids' => :'workflowIds' } end @@ -62,9 +82,14 @@ def self.openapi_types :'country_mandate' => :'String', :'country_code' => :'String', :'description' => :'String', - :'supported_by_partner_api' => :'Boolean', + :'supported_by_elrapi' => :'Boolean', :'mandate_format' => :'String', + :'e_invoicing_flow' => :'String', + :'e_invoicing_flow_documentation_link' => :'String', + :'get_invoice_available_media_type' => :'Array', + :'supports_inbound_digital_document' => :'String', :'input_data_formats' => :'Array', + :'output_data_formats' => :'Array', :'workflow_ids' => :'Array' } end @@ -106,20 +131,44 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end - if attributes.key?(:'supported_by_partner_api') - self.supported_by_partner_api = attributes[:'supported_by_partner_api'] + if attributes.key?(:'supported_by_elrapi') + self.supported_by_elrapi = attributes[:'supported_by_elrapi'] end if attributes.key?(:'mandate_format') self.mandate_format = attributes[:'mandate_format'] end + if attributes.key?(:'e_invoicing_flow') + self.e_invoicing_flow = attributes[:'e_invoicing_flow'] + end + + if attributes.key?(:'e_invoicing_flow_documentation_link') + self.e_invoicing_flow_documentation_link = attributes[:'e_invoicing_flow_documentation_link'] + end + + if attributes.key?(:'get_invoice_available_media_type') + if (value = attributes[:'get_invoice_available_media_type']).is_a?(Array) + self.get_invoice_available_media_type = value + end + end + + if attributes.key?(:'supports_inbound_digital_document') + self.supports_inbound_digital_document = attributes[:'supports_inbound_digital_document'] + end + if attributes.key?(:'input_data_formats') if (value = attributes[:'input_data_formats']).is_a?(Array) self.input_data_formats = value end end + if attributes.key?(:'output_data_formats') + if (value = attributes[:'output_data_formats']).is_a?(Array) + self.output_data_formats = value + end + end + if attributes.key?(:'workflow_ids') if (value = attributes[:'workflow_ids']).is_a?(Array) self.workflow_ids = value @@ -151,9 +200,14 @@ def ==(o) country_mandate == o.country_mandate && country_code == o.country_code && description == o.description && - supported_by_partner_api == o.supported_by_partner_api && + supported_by_elrapi == o.supported_by_elrapi && mandate_format == o.mandate_format && + e_invoicing_flow == o.e_invoicing_flow && + e_invoicing_flow_documentation_link == o.e_invoicing_flow_documentation_link && + get_invoice_available_media_type == o.get_invoice_available_media_type && + supports_inbound_digital_document == o.supports_inbound_digital_document && input_data_formats == o.input_data_formats && + output_data_formats == o.output_data_formats && workflow_ids == o.workflow_ids end @@ -166,7 +220,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [mandate_id, country_mandate, country_code, description, supported_by_partner_api, mandate_format, input_data_formats, workflow_ids].hash + [mandate_id, country_mandate, country_code, description, supported_by_elrapi, mandate_format, e_invoicing_flow, e_invoicing_flow_documentation_link, get_invoice_available_media_type, supports_inbound_digital_document, input_data_formats, output_data_formats, workflow_ids].hash end # Builds the object from hash @@ -282,6 +336,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field.rb b/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field.rb index 5f2841a..52b700a 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # The Data Input Field class MandateDataInputField # Field ID @@ -340,6 +339,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field_namespace.rb b/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field_namespace.rb index 48f2b7b..5167418 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field_namespace.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/mandate_data_input_field_namespace.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # The namespace of the UBL element class MandateDataInputFieldNamespace # The namespace prefix for the UBL Element @@ -218,6 +217,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/mandates_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/mandates_response.rb index c168919..1aacf98 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/mandates_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/mandates_response.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Mandate list response schema class MandatesResponse # Total count of results @@ -231,6 +230,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/not_found_error.rb b/lib/avalara_sdk/models/EInvoicing/V1/not_found_error.rb index 2d5c161..e688c69 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/not_found_error.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/not_found_error.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Returns an HTTP error code and message for a 'not found' error class NotFoundError # The three-digit HTTP error code for a not found error @@ -219,6 +218,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/not_used_for_field.rb b/lib/avalara_sdk/models/EInvoicing/V1/not_used_for_field.rb index d4d5ddb..776e447 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/not_used_for_field.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/not_used_for_field.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Mandates for which this field is not used class NotUsedForField attr_accessor :country_mandate @@ -208,6 +207,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/output_data_formats.rb b/lib/avalara_sdk/models/EInvoicing/V1/output_data_formats.rb new file mode 100644 index 0000000..f4c79a5 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/output_data_formats.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 + # Format and version used when outputting the data + class OutputDataFormats + # Document format + attr_accessor :format + + attr_accessor :versions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'format' => :'format', + :'versions' => :'versions' + } + 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 + { + :'format' => :'String', + :'versions' => :'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::OutputDataFormats` 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::OutputDataFormats`. 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?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'versions') + if (value = attributes[:'versions']).is_a?(Array) + self.versions = 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 && + format == o.format && + versions == o.versions + 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 + [format, versions].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/pagination.rb b/lib/avalara_sdk/models/EInvoicing/V1/pagination.rb new file mode 100644 index 0000000..eb60ad5 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/pagination.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 + # Pagination information for the dataset. + class Pagination + # The total count of records in the dataset. + attr_accessor :recordset_count + + # The URL to the next page of results. + attr_accessor :next_link + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recordset_count' => :'recordsetCount', + :'next_link' => :'@nextLink' + } + 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 + { + :'recordset_count' => :'Integer', + :'next_link' => :'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::Pagination` 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::Pagination`. 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?(:'recordset_count') + self.recordset_count = attributes[:'recordset_count'] + end + + if attributes.key?(:'next_link') + self.next_link = attributes[:'next_link'] + 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 && + recordset_count == o.recordset_count && + next_link == o.next_link + 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 + [recordset_count, next_link].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/required_when_field.rb b/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb index 0612263..562ea79 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb @@ -1,17 +1,17 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 - class RequiredWhenField + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Mandates for which this field is required + class RequiredWhenField attr_accessor :scenario # Attribute mapping from ruby-style variable name to JSON key. @@ -207,6 +207,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/signature.rb b/lib/avalara_sdk/models/EInvoicing/V1/signature.rb new file mode 100644 index 0000000..a4785df --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/signature.rb @@ -0,0 +1,218 @@ +=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 + # Defines the signature configuration, specifying whether and how messages are signed for webhook delivery. + class Signature + attr_accessor :signature + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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 + { + :'signature' => :'SignatureSignature' + } + 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::Signature` 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::Signature`. 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?(:'signature') + self.signature = attributes[:'signature'] + else + self.signature = 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 @signature.nil? + invalid_properties.push('invalid value for "signature", signature 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 @signature.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 && + 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 + [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::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_signature.rb b/lib/avalara_sdk/models/EInvoicing/V1/signature_signature.rb new file mode 100644 index 0000000..90f1864 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/signature_signature.rb @@ -0,0 +1,297 @@ +=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 SignatureSignature + attr_accessor :type + + # HMAC key for authentication + attr_accessor :key + + # HMAC algorithm for authentication + attr_accessor :algorithm + + 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', + :'key' => :'key', + :'algorithm' => :'algorithm' + } + 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', + :'key' => :'String', + :'algorithm' => :'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::SignatureSignature` 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::SignatureSignature`. 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'] + else + self.type = nil + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + else + self.key = nil + end + + if attributes.key?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + else + self.algorithm = 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 @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @key.nil? + invalid_properties.push('invalid value for "key", key cannot be nil.') + end + + if @algorithm.nil? + invalid_properties.push('invalid value for "algorithm", algorithm 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 @type.nil? + type_validator = EnumAttributeValidator.new('String', ["none", "hmac"]) + return false unless type_validator.valid?(@type) + return false if @key.nil? + return false if @algorithm.nil? + algorithm_validator = EnumAttributeValidator.new('String', ["sha256", "sha384", "sha512"]) + return false unless algorithm_validator.valid?(@algorithm) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["none", "hmac"]) + 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] algorithm Object to be assigned + def algorithm=(algorithm) + validator = EnumAttributeValidator.new('String', ["sha256", "sha384", "sha512"]) + unless validator.valid?(algorithm) + fail ArgumentError, "invalid value for \"algorithm\", must be one of #{validator.allowable_values}." + end + @algorithm = algorithm + 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 && + key == o.key && + algorithm == o.algorithm + 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, key, algorithm].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_value.rb b/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb new file mode 100644 index 0000000..4e6380c --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb @@ -0,0 +1,218 @@ +=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 + # Includes the actual signature applied to a webhook message along with the algorithm used. + class SignatureValue + attr_accessor :signature + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'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 + { + :'signature' => :'SignatureValueSignature' + } + 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::SignatureValue` 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::SignatureValue`. 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?(:'signature') + self.signature = attributes[:'signature'] + else + self.signature = 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 @signature.nil? + invalid_properties.push('invalid value for "signature", signature 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 @signature.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 && + 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 + [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::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_value_signature.rb b/lib/avalara_sdk/models/EInvoicing/V1/signature_value_signature.rb new file mode 100644 index 0000000..54b650a --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/signature_value_signature.rb @@ -0,0 +1,297 @@ +=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 SignatureValueSignature + attr_accessor :type + + # The algorithm used to create the signature. + attr_accessor :algorithm + + # Signature of the message. + attr_accessor :value + + 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', + :'algorithm' => :'algorithm', + :'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 + { + :'type' => :'String', + :'algorithm' => :'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::SignatureValueSignature` 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::SignatureValueSignature`. 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'] + else + self.type = nil + end + + if attributes.key?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + else + self.algorithm = nil + 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 @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @algorithm.nil? + invalid_properties.push('invalid value for "algorithm", algorithm cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value 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 @type.nil? + type_validator = EnumAttributeValidator.new('String', ["none", "hmac"]) + return false unless type_validator.valid?(@type) + return false if @algorithm.nil? + algorithm_validator = EnumAttributeValidator.new('String', ["sha256"]) + return false unless algorithm_validator.valid?(@algorithm) + return false if @value.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["none", "hmac"]) + 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] algorithm Object to be assigned + def algorithm=(algorithm) + validator = EnumAttributeValidator.new('String', ["sha256"]) + unless validator.valid?(algorithm) + fail ArgumentError, "invalid value for \"algorithm\", must be one of #{validator.allowable_values}." + end + @algorithm = algorithm + 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 && + algorithm == o.algorithm && + 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 + [type, algorithm, 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/status_event.rb b/lib/avalara_sdk/models/EInvoicing/V1/status_event.rb index 335ccd1..a9a5a22 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/status_event.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/status_event.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Displays when a status event occurred class StatusEvent # The date and time when the status event occured, displayed in the format YYYY-MM-DDThh:mm:ss @@ -241,6 +240,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/submit_document_metadata.rb b/lib/avalara_sdk/models/EInvoicing/V1/submit_document_metadata.rb index 9921990..20bc783 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/submit_document_metadata.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/submit_document_metadata.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Key value pairs of metadata for a document submission
{  \"workflowId\": \"partner-einvoicing\", \"dataFormat\": \"ubl-invoice\", \"dataFormatVersion\": \"2.1\", \"countryCode\": \"SA\", \"countryMandate\": \"SA-Phase1-B2B\" }

class SubmitDocumentMetadata # Specifies a unique ID for this workflow. @@ -22,6 +21,12 @@ class SubmitDocumentMetadata # Specifies the data format version number. attr_accessor :data_format_version + # Specifies the format of the output document to be generated for the recipient. This format should be chosen based on the recipient's preferences or requirements as defined by applicable e-invoicing regulations. When not specified for mandates that don't require a specific output format, the system will use the default format defined for that mandate. + attr_accessor :output_data_format + + # Specifies the version of the selected output document format + attr_accessor :output_data_format_version + # The two-letter ISO-3166 country code for the country where the document is being submitted attr_accessor :country_code @@ -34,6 +39,8 @@ def self.attribute_map :'workflow_id' => :'workflowId', :'data_format' => :'dataFormat', :'data_format_version' => :'dataFormatVersion', + :'output_data_format' => :'outputDataFormat', + :'output_data_format_version' => :'outputDataFormatVersion', :'country_code' => :'countryCode', :'country_mandate' => :'countryMandate' } @@ -50,6 +57,8 @@ def self.openapi_types :'workflow_id' => :'String', :'data_format' => :'String', :'data_format_version' => :'String', + :'output_data_format' => :'String', + :'output_data_format_version' => :'String', :'country_code' => :'String', :'country_mandate' => :'String' } @@ -94,6 +103,14 @@ def initialize(attributes = {}) self.data_format_version = nil end + if attributes.key?(:'output_data_format') + self.output_data_format = attributes[:'output_data_format'] + end + + if attributes.key?(:'output_data_format_version') + self.output_data_format_version = attributes[:'output_data_format_version'] + end + if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] else @@ -155,6 +172,8 @@ def ==(o) workflow_id == o.workflow_id && data_format == o.data_format && data_format_version == o.data_format_version && + output_data_format == o.output_data_format && + output_data_format_version == o.output_data_format_version && country_code == o.country_code && country_mandate == o.country_mandate end @@ -168,7 +187,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [workflow_id, data_format, data_format_version, country_code, country_mandate].hash + [workflow_id, data_format, data_format_version, output_data_format, output_data_format_version, country_code, country_mandate].hash end # Builds the object from hash @@ -284,6 +303,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/submit_interop_document202_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/submit_interop_document202_response.rb index 9db0d17..424fe9e 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/submit_interop_document202_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/submit_interop_document202_response.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 class SubmitInteropDocument202Response # The unique interchange ID for this submission. attr_accessor :interchange_id @@ -218,6 +217,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb b/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb new file mode 100644 index 0000000..c5b00a6 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb @@ -0,0 +1,229 @@ +=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 + # Basic configuration for a webhook subscription, including description and target notification URL. + class SubscriptionCommon + # Description of the subscription + attr_accessor :description + + # The URL of the webhook endpoint to which event messages will be delivered + attr_accessor :notification_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'description' => :'description', + :'notification_url' => :'notificationUrl' + } + 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 + { + :'description' => :'String', + :'notification_url' => :'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::SubscriptionCommon` 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::SubscriptionCommon`. 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'notification_url') + self.notification_url = attributes[:'notification_url'] + else + self.notification_url = 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 @notification_url.nil? + invalid_properties.push('invalid value for "notification_url", notification_url 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 @notification_url.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 && + description == o.description && + notification_url == o.notification_url + 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 + [description, notification_url].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/subscription_detail.rb b/lib/avalara_sdk/models/EInvoicing/V1/subscription_detail.rb new file mode 100644 index 0000000..089befa --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/subscription_detail.rb @@ -0,0 +1,288 @@ +=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 SubscriptionDetail + # Unique identifier of this specific resource. + attr_accessor :id + + # Description of the subscription + attr_accessor :description + + # The URL of the webhook endpoint to which event messages will be delivered + attr_accessor :notification_url + + attr_accessor :signature + + attr_accessor :events + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'description' => :'description', + :'notification_url' => :'notificationUrl', + :'signature' => :'signature', + :'events' => :'events' + } + 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', + :'description' => :'String', + :'notification_url' => :'String', + :'signature' => :'SignatureSignature', + :'events' => :'Array' + } + 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 + [ + :'Id', + :'Signature', + :'SubscriptionCommon' + ] + 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::SubscriptionDetail` 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::SubscriptionDetail`. 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'notification_url') + self.notification_url = attributes[:'notification_url'] + else + self.notification_url = nil + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + else + self.signature = nil + end + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + else + self.events = 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 @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @notification_url.nil? + invalid_properties.push('invalid value for "notification_url", notification_url cannot be nil.') + end + + if @signature.nil? + invalid_properties.push('invalid value for "signature", signature cannot be nil.') + end + + if @events.nil? + invalid_properties.push('invalid value for "events", events 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 @notification_url.nil? + return false if @signature.nil? + return false if @events.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 && + id == o.id && + description == o.description && + notification_url == o.notification_url && + signature == o.signature && + events == o.events + 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, description, notification_url, signature, events].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/subscription_list_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/subscription_list_response.rb new file mode 100644 index 0000000..7f5027c --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/subscription_list_response.rb @@ -0,0 +1,240 @@ +=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 SubscriptionListResponse + # The total count of records in the dataset. + attr_accessor :recordset_count + + # The URL to the next page of results. + attr_accessor :next_link + + # The list of subscriptions. + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recordset_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 + { + :'recordset_count' => :'Integer', + :'next_link' => :'String', + :'value' => :'Array' + } + 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 + [ + :'Pagination' + ] + 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::SubscriptionListResponse` 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::SubscriptionListResponse`. 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?(:'recordset_count') + self.recordset_count = attributes[:'recordset_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 && + recordset_count == o.recordset_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 + [recordset_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/subscription_registration.rb b/lib/avalara_sdk/models/EInvoicing/V1/subscription_registration.rb new file mode 100644 index 0000000..845db22 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/subscription_registration.rb @@ -0,0 +1,270 @@ +=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 SubscriptionRegistration + # Description of the subscription + attr_accessor :description + + # The URL of the webhook endpoint to which event messages will be delivered + attr_accessor :notification_url + + attr_accessor :signature + + attr_accessor :events + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'description' => :'description', + :'notification_url' => :'notificationUrl', + :'signature' => :'signature', + :'events' => :'events' + } + 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 + { + :'description' => :'String', + :'notification_url' => :'String', + :'signature' => :'SignatureSignature', + :'events' => :'Array' + } + 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 + [ + :'Signature', + :'SubscriptionCommon' + ] + 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::SubscriptionRegistration` 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::SubscriptionRegistration`. 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'notification_url') + self.notification_url = attributes[:'notification_url'] + else + self.notification_url = nil + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + else + self.signature = nil + end + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + else + self.events = 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 @notification_url.nil? + invalid_properties.push('invalid value for "notification_url", notification_url cannot be nil.') + end + + if @signature.nil? + invalid_properties.push('invalid value for "signature", signature cannot be nil.') + end + + if @events.nil? + invalid_properties.push('invalid value for "events", events 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 @notification_url.nil? + return false if @signature.nil? + return false if @events.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 && + description == o.description && + notification_url == o.notification_url && + signature == o.signature && + events == o.events + 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 + [description, notification_url, signature, events].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/success_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/success_response.rb new file mode 100644 index 0000000..6af1b03 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/success_response.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 + # Indicates a successful outcome of an API operation, including a generated ID and success message. + class SuccessResponse + # Unique identifier for the new or updated entity. + attr_accessor :id + + # Success message + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'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', + :'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::SuccessResponse` 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::SuccessResponse`. 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?(:'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 && + 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, 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/webhook_invocation.rb b/lib/avalara_sdk/models/EInvoicing/V1/webhook_invocation.rb new file mode 100644 index 0000000..01fdaf6 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/webhook_invocation.rb @@ -0,0 +1,291 @@ +=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 WebhookInvocation + # Unique identifier of this specific resource. + attr_accessor :id + + # The number of invocation attempts. + attr_accessor :retry_count + + # The maximum retries that may be attempted in total. + attr_accessor :retry_max + + # Initial timestamp of the first invocation attempt. + attr_accessor :invocation_timestamp + + # Timestamp of this invocation attempt. + attr_accessor :retry_timestamp + + # Array of events being delivered in the webhook + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'retry_count' => :'retryCount', + :'retry_max' => :'retryMax', + :'invocation_timestamp' => :'invocationTimestamp', + :'retry_timestamp' => :'retryTimestamp', + :'items' => :'items' + } + 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', + :'retry_count' => :'Integer', + :'retry_max' => :'Integer', + :'invocation_timestamp' => :'Time', + :'retry_timestamp' => :'Time', + :'items' => :'Array' + } + 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 + [ + :'Id' + ] + 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::WebhookInvocation` 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::WebhookInvocation`. 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?(:'retry_count') + self.retry_count = attributes[:'retry_count'] + end + + if attributes.key?(:'retry_max') + self.retry_max = attributes[:'retry_max'] + end + + if attributes.key?(:'invocation_timestamp') + self.invocation_timestamp = attributes[:'invocation_timestamp'] + else + self.invocation_timestamp = nil + end + + if attributes.key?(:'retry_timestamp') + self.retry_timestamp = attributes[:'retry_timestamp'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + else + self.items = 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 @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @invocation_timestamp.nil? + invalid_properties.push('invalid value for "invocation_timestamp", invocation_timestamp cannot be nil.') + end + + if @items.nil? + invalid_properties.push('invalid value for "items", items 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 @invocation_timestamp.nil? + return false if @items.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 && + id == o.id && + retry_count == o.retry_count && + retry_max == o.retry_max && + invocation_timestamp == o.invocation_timestamp && + retry_timestamp == o.retry_timestamp && + items == o.items + 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, retry_count, retry_max, invocation_timestamp, retry_timestamp, items].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_info.rb b/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_info.rb new file mode 100644 index 0000000..82ec450 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_info.rb @@ -0,0 +1,242 @@ +=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 + # Information about the error encountered + class WebhooksErrorInfo + # An identifying name for the error. + attr_accessor :title + + # A conanoical error status. + attr_accessor :status + + # A detailed description of the error type. + attr_accessor :detail + + # A detailed description of the specific error ocurrance. + attr_accessor :instance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'title' => :'title', + :'status' => :'status', + :'detail' => :'detail', + :'instance' => :'instance' + } + 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 + { + :'title' => :'String', + :'status' => :'String', + :'detail' => :'String', + :'instance' => :'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::WebhooksErrorInfo` 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::WebhooksErrorInfo`. 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?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + + if attributes.key?(:'instance') + self.instance = attributes[:'instance'] + 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 && + title == o.title && + status == o.status && + detail == o.detail && + instance == o.instance + 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 + [title, status, detail, instance].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 new file mode 100644 index 0000000..a17fbb8 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb @@ -0,0 +1,211 @@ +=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 + # Wrapper for errors occurring during webhook subscription or delivery processing. + class WebhooksErrorResponse + attr_accessor :error + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error' => :'error' + } + 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 + { + :'error' => :'WebhooksErrorInfo' + } + 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::WebhooksErrorResponse` 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::WebhooksErrorResponse`. 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?(:'error') + self.error = attributes[:'error'] + 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 && + error == o.error + 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 + [error].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/workflow_ids.rb b/lib/avalara_sdk/models/EInvoicing/V1/workflow_ids.rb index 3d62a81..04a5975 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/workflow_ids.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/workflow_ids.rb @@ -1,16 +1,15 @@ -=begin +=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 - module AvalaraSdk::EInvoicing::V1 + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 # Workflow ID list class WorkflowIds # The name of this workflow @@ -219,6 +218,5 @@ def _to_hash(value) end end - - end -end + +end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb deleted file mode 100644 index 3c8e3cc..0000000 --- a/spec/api_client_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -# =begin -# #Avalara Shipping Verification only - -# #API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. This API is currently in beta. - -# SDK Version : 2.4.6 - - -# =end - -require 'avalara_sdk/token_metadata' -require 'dotenv/load' - -describe AvalaraSdk::ApiClient do - before(:all) do - config = AvalaraSdk::Configuration.new - config.client_id = ENV["CLIENT_ID"] - config.client_secret = " " - config.environment='qa' - config.app_name="testApp" - config.app_version="2.3.1" - config.machine_name="AVL_WIN_007" - @api_client = AvalaraSdk::ApiClient.new config - @required_scopes ='avatax_api' - @access_token ='test_token' - @token_endpoint = 'https://ai-awsfqa.avlr.sh/connect/token' - @expiry_time = 3600 - end - - before(:each) do - # Mock OIDC Endpoint - allow(Faraday).to receive(:get) {instance_double(Faraday::Response, body: "{ \"token_endpoint\": \"#{@token_endpoint}\" }")} - # Mock Token endpoint - allow(Faraday).to receive(:post) {instance_double(Faraday::Response, body:"{ \"access_token\": \"#{@access_token}\", \"expires_in\": #{@expiry_time} }")} - end - - context "OAuth Helpers" do - it "should get OAuth access token" do - token = @api_client.get_oauth_access_token(@required_scopes) - expect(token).to be_nil - # Set timeout for 6 minutes, if the timeout is less than 5 minutes it will - token_metadata = AvalaraSdk::TokenMetadata.new(@access_token, Time.now+360) - @api_client.access_token_map['avatax_api'] = token_metadata - token = @api_client.get_oauth_access_token(@required_scopes) - expect(token).to eq(@access_token) - end - - it "should not get expired OAuth access token" do - # Set timeout for 4 minutes, if the timeout is less than 5 minutes it will - token_metadata = AvalaraSdk::TokenMetadata.new(@access_token, Time.now+240) - @api_client.access_token_map['avatax_api'] = token_metadata - token = @api_client.get_oauth_access_token(@required_scopes) - expect(token).to be_nil - end - - it "should update OAuth access token" do - @api_client.update_oauth_access_token @required_scopes, nil - token = @api_client.get_oauth_access_token(@required_scopes) - expect(token).to eq(@access_token) - end - - it "should invalidate expired OAuth access token" do - # invalidate expired token scenario - allow(@api_client).to receive(:build_oauth_request).and_return({"access_token" => "new_token", "expires_in"=>@expiry_time }) - @api_client.update_oauth_access_token @required_scopes, @access_token - token = @api_client.get_oauth_access_token(@required_scopes) - expect(token).to eq("new_token") - end - end -end diff --git a/spec/integration/documentsapi_test_spec.rb b/spec/integration/documentsapi_test_spec.rb index 9458994..7ab404d 100644 --- a/spec/integration/documentsapi_test_spec.rb +++ b/spec/integration/documentsapi_test_spec.rb @@ -5,7 +5,7 @@ describe 'DocumentsAPI' do before(:all) do config = AvalaraSdk::Configuration.new - config.bearer_token = ENV["BEARER_TOKEN"] + config.bearer_token = 'eyJhbGciOiJSUzI1NiIsImtpZCI6IkRFMjlBOUU2MTQ1OUNDRjAxNjAxQzk1RTk5NzkwMDg1NjUzRTQwRTFSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjNpbXA1aFJaelBBV0FjbGVtWGtBaFdVLVFPRSJ9.eyJuYmYiOjE3NDk4Mjg5MTYsImV4cCI6MTc0OTgzMjUxNiwiaXNzIjoiaHR0cHM6Ly9haS1zYnguYXZsci5zaCIsImNsaWVudF9pZCI6IjhjYzk1ZjY5ZTcxZTRjNDE5NzA1NTFlNmZjMDVkMjhmIiwib3JnIjoiNjRjOGZmNzAxNjM0YWNjZGZiM2I1MDgyIiwidGlkIjoiNjRjOGZmNzAzNTU2MTViNTU0YTEyOTgxIiwiYXBwSWQiOiI2NGM4ZmY3NTE2MzRhY2NkZmIzYjUwODUiLCJ0LWdydCI6IntcInVybjphdmFsYXJhOnN5c3RlbXM6ZGVzXCI6W3tcInBcIjpbXCJkb2N1bWVudF9zdWJtaXRcIixcImRvY3VtZW50X3JlYWRcIixcImRvY3VtZW50X3NlYXJjaFwiLFwiZG9jdW1lbnRfc3RhdHVzXCIsXCJkZWZpbml0aW9uc192aWV3XCIsXCJkaXJlY3Rvcnlfc2VhcmNoXCIsXCJ3ZWJob29rX2NyZWF0ZVwiLFwid2ViaG9va19yZWFkXCIsXCJ3ZWJob29rX2RlbGV0ZVwiXSxcImNcIjpcIlwifV0sXCJ1cm46YXZhbGFyYTpzeXN0ZW1zOm9ybFwiOlt7XCJwXCI6W1wiUmVnaXN0cmF0aW9uX3JlYWRcIl0sXCJjXCI6XCJyZWdpc3RyYXRpb25UeXBlIEVRICdFLUludm9pY2UnXCJ9XSxcInVybjphdmFsYXJhOnN5c3RlbXM6Y29tcGFueVwiOlt7XCJwXCI6W1wiQ29tcGFueV9jcmVhdGVcIixcIkNvbXBhbnlfdXBkYXRlXCIsXCJDb21wYW55X2ZldGNoXCJdLFwiY1wiOlwiVGVuYW50SWQgRVEgdG9rZW4vdGVuYW50SWRcIn0se1wicFwiOltcImNvbXBhbnlfYXNwZWN0X2NyZWF0ZVwiLFwiY29tcGFueV9hc3BlY3RfZmV0Y2hcIixcImNvbXBhbnlfYXNwZWN0X3VwZGF0ZVwiLFwiY29tcGFueV9hc3BlY3RfZGVsZXRlXCJdLFwiY1wiOlwiXCJ9XX0iLCJjLWdydCI6Int9Iiwicm9sZXMiOiJ7XCJ1cm46YXZhbGFyYTpzeXN0ZW1zOmRlc1wiOltcIkRFUy1BUEktQ29uc3VtZXJcIl0sXCJ1cm46YXZhbGFyYTpzeXN0ZW1zOm9ybFwiOltcIlZpZXdlclwiXSxcInVybjphdmFsYXJhOnN5c3RlbXM6Y29tcGFueVwiOltcIk9QVVNSb2xlXCJdfSIsImp0aSI6IjkyRTQ0NkQ3OEQyN0Q2MEFGMzQwMjc5Q0Q0NTZFMEFCIiwiaWF0IjoxNzQ5ODI4OTE2LCJzY29wZSI6WyJkZXNfYXBpIiwib3JsX2FwaSIsInNjcyJdfQ.W4uM9A9_REYz4axmw-y86YvwddTENzyB0gGANk-OZ0kbZdcGNOuo5vEkVyRi5fCdPVpeAgsbTOh71ii8y-U_rvuZ2Ux-SEJqhgcrYHtLbUdFzyUWA4mryCtYsJX71MreMQ8i0Qj2fHcv4GvFG5zG3CjaRS7hrwnejwNvlqQ6qjGndH4LDyeb2MJR5eO71AbZlmSTcXzaatCbDHxibvIwzXv_vYMz8MCaO0lc_1pzU_GYrsgujdayUEkKjrJLbOx91-LcLvKicK1VF81FCnLBvpp48YLbqYApo9LX5og1EqDFmanU8CtbuWtcYj4j6fhJiqPVw4nsc-1Siqg3X--WZA' config.environment='sandbox' config.app_name="testApp" config.app_version="2.3.1" @@ -16,7 +16,7 @@ end describe 'test EInvoicing Documents endpoint' do - get_doc_request = AvalaraSdk::EInvoicing::V1::GetDocumentListRequest.new + get_doc_request = AvalaraSdk::EInvoicing::V1::GetDocumentListRequestSdk.new it 'should be able to call list documents without exception' do result = nil begin From 22b6c23780b692c1a438f547e860b6077419cec7 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Thu, 19 Jun 2025 12:52:05 -0700 Subject: [PATCH 2/7] Update ruby with tests --- .github/workflows/gem-push.yml | 20 ++++- .github/workflows/test.yml | 20 +++-- .rspec | 4 +- Gemfile.lock | 6 +- lib/avalara_sdk/api_client.rb | 86 ++++++++++++---------- lib/avalara_sdk/version.rb | 2 +- spec/integration/a1099_spec.rb | 64 ++++++++++++++++ spec/integration/documentsapi_test_spec.rb | 34 --------- spec/integration/einvoicing_spec.rb | 34 +++++++++ spec/spec_helper.rb | 13 +--- 10 files changed, 185 insertions(+), 98 deletions(-) create mode 100644 spec/integration/a1099_spec.rb delete mode 100644 spec/integration/documentsapi_test_spec.rb create mode 100644 spec/integration/einvoicing_spec.rb diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index dd0b7ad..284b128 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -18,7 +18,7 @@ jobs: packages: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set env run: | echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV @@ -32,14 +32,23 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Retrieve bearer token - id: get_bearer_token + - name: Retrieve bearer token for EInvoicing + id: get_bearer_token_einvoicing run: | response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}") token=$(echo $response | jq -r '.access_token') - echo "BEARER_TOKEN=${token}" >> $GITHUB_ENV + echo "BEARER_TOKEN_EINVOICING=${token}" >> $GITHUB_ENV + + - name: Retrieve bearer token for A1099 + id: get_bearer_token_a1099 + run: | + response=$(curl -X POST ${{secrets.AI_SBX_URL}}/connect/token \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "grant_type=client_credentials&client_id=${{secrets.AI_CLIENT_ID_A1099}}&client_secret=${{secrets.AI_CLIENT_SECRET_A1099}}") + token=$(echo $response | jq -r '.access_token') + echo "BEARER_TOKEN_A1099=${token}" >> $GITHUB_ENV - name: Run Integration Tests run: | @@ -47,6 +56,9 @@ jobs: bundle config set --local path 'vendor/bundle' bundle install bundle exec rspec + env: + BEARER_TOKEN_EINVOICING: ${{ env.BEARER_TOKEN_EINVOICING }} + BEARER_TOKEN_A1099: ${{ env.BEARER_TOKEN_A1099 }} - name: Update Ruby SDK version run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e49d7f4..184f461 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,21 +20,30 @@ jobs: packages: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Ruby Versions uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Retrieve bearer token - id: get_bearer_token + - name: Retrieve bearer token for EInvoicing + id: get_bearer_token_einvoicing run: | response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}") token=$(echo $response | jq -r '.access_token') - echo "BEARER_TOKEN=${token}" >> $GITHUB_ENV + echo "BEARER_TOKEN_EINVOICING=${token}" >> $GITHUB_ENV + + - name: Retrieve bearer token for A1099 + id: get_bearer_token_a1099 + run: | + response=$(curl -X POST ${{secrets.AI_SBX_URL}}/connect/token \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "grant_type=client_credentials&client_id=${{secrets.AI_CLIENT_ID_A1099}}&client_secret=${{secrets.AI_CLIENT_SECRET_A1099}}") + token=$(echo $response | jq -r '.access_token') + echo "BEARER_TOKEN_A1099=${token}" >> $GITHUB_ENV - name: Build & test run: | @@ -43,4 +52,5 @@ jobs: bundle install bundle exec rspec env: - BEARER_TOKEN: ${{ env.BEARER_TOKEN }} + BEARER_TOKEN_EINVOICING: ${{ env.BEARER_TOKEN_EINVOICING }} + BEARER_TOKEN_A1099: ${{ env.BEARER_TOKEN_A1099 }} diff --git a/.rspec b/.rspec index 2d868da..0b6df29 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,4 @@ ---color +--require bundler/setup --require spec_helper +--format documentation +--color \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 3be8589..132d3fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - avalara_sdk (24.12.2) + avalara_sdk (25.6.0) faraday (~> 1.0, >= 1.0.1) GEM @@ -30,10 +30,10 @@ GEM faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) + faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.1.0) + faraday-multipart (1.1.1) multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) diff --git a/lib/avalara_sdk/api_client.rb b/lib/avalara_sdk/api_client.rb index b31c5dd..99e3ab8 100644 --- a/lib/avalara_sdk/api_client.rb +++ b/lib/avalara_sdk/api_client.rb @@ -1,15 +1,3 @@ -=begin -#Avalara Shipping Verification for Beverage Alcohol - -#API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. This API is currently in beta. - -The version of the OpenAPI document: 2.1.0-beta - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 - -=end - require 'date' require 'json' require 'logger' @@ -84,8 +72,9 @@ def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = fals :client_cert => @config.ssl_client_cert, :client_key => @config.ssl_client_key } - + base_url = @config.get_base_path(microservice) + connection = Faraday.new(:url => base_url, :ssl => ssl_options) do |conn| @config.configure_middleware(conn) if opts[:header_params]["Content-Type"] == "multipart/form-data" @@ -97,6 +86,7 @@ def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = fals begin response = connection.public_send(http_method.to_sym.downcase) do |req| + full_url = connection.build_url(path, opts[:query_params]) build_request(http_method, path, req, opts) end @@ -140,36 +130,52 @@ def call_api(http_method, path, opts = {}, required_scopes = "", is_retry = fals # @option opts [Hash] :form_params Query parameters # @option opts [Object] :body HTTP body (JSON/XML) # @return [Faraday::Request] A Faraday Request - def build_request(http_method, path, request, opts = {}) - url = build_request_url(path, opts) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - header_params['X-Avalara-Client']="#{@config.app_name};#{@config.app_version};RubySdk;#{@sdk_version};#{@config.machine_name}" - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - req_opts = { - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end + def build_request(http_method, path, request, opts = {}) + # Compute a relative URL (no leading slash) so Faraday merges correctly + relative_url = build_request_url(path).sub(%r{^/}, '') + + header_params = @default_headers.merge(opts[:header_params] || {}) + header_params['X-Avalara-Client'] = + "#{@config.app_name};#{@config.app_version};RubySdk;#{@sdk_version};#{@config.machine_name}" + + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + # Build body if needed + http_method_sym = http_method.to_sym.downcase + if [:post, :patch, :put, :delete].include?(http_method_sym) + req_body = build_request_body(header_params, form_params, opts[:body]) + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n\#{req_body}\n~END~" end - request.headers = header_params - request.body = req_body - request.options = OpenStruct.new(req_opts) - request.url url - request.params = query_params - download_file(request) if opts[:return_type] == 'File' - request end + # Apply headers, body, and options + request.headers = header_params + request.body = req_body + request.options = OpenStruct.new( + params_encoding: @config.params_encoding, + timeout: @config.timeout, + verbose: @config.debugging + ) + + # Use a relative path so URL prefix (/avalara1099/) is preserved + request.url relative_url + request.params = query_params + + download_file(request) if opts[:return_type] == 'File' + request + end + + # Builds the HTTP request URL fragment + # now returns a path WITHOUT a leading slash + def build_request_url(path) + # Normalize slashes + clean = "/\#{path}".gsub(/\/+/, '/') + # Drop leading slash for Faraday-relative URLs + clean.sub(%r{^/}, '') + end + # Builds the HTTP request body # # @param [Hash] header_params Header parameters diff --git a/lib/avalara_sdk/version.rb b/lib/avalara_sdk/version.rb index 0b51534..d119f36 100644 --- a/lib/avalara_sdk/version.rb +++ b/lib/avalara_sdk/version.rb @@ -9,5 +9,5 @@ =end module AvalaraSdk - VERSION = '24.12.2' + VERSION = '25.6.0' end diff --git a/spec/integration/a1099_spec.rb b/spec/integration/a1099_spec.rb new file mode 100644 index 0000000..d4b5c89 --- /dev/null +++ b/spec/integration/a1099_spec.rb @@ -0,0 +1,64 @@ +require 'json' +require 'dotenv/load' +require 'securerandom' + +describe 'A1099Api' do + before(:all) do + config = AvalaraSdk::Configuration.new + config.bearer_token = ENV['BEARER_TOKEN_A1099'] + config.environment = 'sandbox' + config.app_name = 'testApp' + config.app_version = '1.0' + config.machine_name = 'test-machine' + config.debugging = true + + @api_client = AvalaraSdk::ApiClient.new(config) + @issuers_api = AvalaraSdk::A1099::V2::Issuers1099Api.new(@api_client) + @companies_api = AvalaraSdk::A1099::V2::CompaniesW9Api.new(@api_client) + @forms1099_api = AvalaraSdk::A1099::V2::Forms1099Api.new(@api_client) + end + + describe 'GetIssuers endpoint' do + it 'retrieves a list of issuers' do + request = AvalaraSdk::A1099::V2::GetIssuersRequestSdk.new + request.avalara_version = '2.0' + request.x_correlation_id = SecureRandom.uuid + request.top = 10 + request.skip = 0 + request.count = true + + result = @issuers_api.get_issuers(request) + expect(result).not_to be_nil + expect(result.value).not_to be_nil + end + end + + describe 'GetCompanies endpoint' do + it 'retrieves a list of companies' do + request = AvalaraSdk::A1099::V2::GetCompaniesRequestSdk.new + request.avalara_version = '2.0' + request.x_correlation_id = SecureRandom.uuid + request.top = 10 + request.skip = 0 + request.count = true + + result = @companies_api.get_companies(request) + expect(result).not_to be_nil + expect(result.value).not_to be_nil + end + end + + describe 'List1099Forms endpoint' do + it 'retrieves a list of 1099 forms' do + request = AvalaraSdk::A1099::V2::List1099FormsRequestSdk.new + request.avalara_version = '2.0' + request.x_correlation_id = SecureRandom.uuid + request.top = 10 + request.skip = 0 + + result = @forms1099_api.list1099_forms(request) + expect(result).not_to be_nil + expect(result.data).not_to be_nil + end + end +end diff --git a/spec/integration/documentsapi_test_spec.rb b/spec/integration/documentsapi_test_spec.rb deleted file mode 100644 index 7ab404d..0000000 --- a/spec/integration/documentsapi_test_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'json' -require 'dotenv/load' -require 'securerandom' - -describe 'DocumentsAPI' do - before(:all) do - config = AvalaraSdk::Configuration.new - config.bearer_token = 'eyJhbGciOiJSUzI1NiIsImtpZCI6IkRFMjlBOUU2MTQ1OUNDRjAxNjAxQzk1RTk5NzkwMDg1NjUzRTQwRTFSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjNpbXA1aFJaelBBV0FjbGVtWGtBaFdVLVFPRSJ9.eyJuYmYiOjE3NDk4Mjg5MTYsImV4cCI6MTc0OTgzMjUxNiwiaXNzIjoiaHR0cHM6Ly9haS1zYnguYXZsci5zaCIsImNsaWVudF9pZCI6IjhjYzk1ZjY5ZTcxZTRjNDE5NzA1NTFlNmZjMDVkMjhmIiwib3JnIjoiNjRjOGZmNzAxNjM0YWNjZGZiM2I1MDgyIiwidGlkIjoiNjRjOGZmNzAzNTU2MTViNTU0YTEyOTgxIiwiYXBwSWQiOiI2NGM4ZmY3NTE2MzRhY2NkZmIzYjUwODUiLCJ0LWdydCI6IntcInVybjphdmFsYXJhOnN5c3RlbXM6ZGVzXCI6W3tcInBcIjpbXCJkb2N1bWVudF9zdWJtaXRcIixcImRvY3VtZW50X3JlYWRcIixcImRvY3VtZW50X3NlYXJjaFwiLFwiZG9jdW1lbnRfc3RhdHVzXCIsXCJkZWZpbml0aW9uc192aWV3XCIsXCJkaXJlY3Rvcnlfc2VhcmNoXCIsXCJ3ZWJob29rX2NyZWF0ZVwiLFwid2ViaG9va19yZWFkXCIsXCJ3ZWJob29rX2RlbGV0ZVwiXSxcImNcIjpcIlwifV0sXCJ1cm46YXZhbGFyYTpzeXN0ZW1zOm9ybFwiOlt7XCJwXCI6W1wiUmVnaXN0cmF0aW9uX3JlYWRcIl0sXCJjXCI6XCJyZWdpc3RyYXRpb25UeXBlIEVRICdFLUludm9pY2UnXCJ9XSxcInVybjphdmFsYXJhOnN5c3RlbXM6Y29tcGFueVwiOlt7XCJwXCI6W1wiQ29tcGFueV9jcmVhdGVcIixcIkNvbXBhbnlfdXBkYXRlXCIsXCJDb21wYW55X2ZldGNoXCJdLFwiY1wiOlwiVGVuYW50SWQgRVEgdG9rZW4vdGVuYW50SWRcIn0se1wicFwiOltcImNvbXBhbnlfYXNwZWN0X2NyZWF0ZVwiLFwiY29tcGFueV9hc3BlY3RfZmV0Y2hcIixcImNvbXBhbnlfYXNwZWN0X3VwZGF0ZVwiLFwiY29tcGFueV9hc3BlY3RfZGVsZXRlXCJdLFwiY1wiOlwiXCJ9XX0iLCJjLWdydCI6Int9Iiwicm9sZXMiOiJ7XCJ1cm46YXZhbGFyYTpzeXN0ZW1zOmRlc1wiOltcIkRFUy1BUEktQ29uc3VtZXJcIl0sXCJ1cm46YXZhbGFyYTpzeXN0ZW1zOm9ybFwiOltcIlZpZXdlclwiXSxcInVybjphdmFsYXJhOnN5c3RlbXM6Y29tcGFueVwiOltcIk9QVVNSb2xlXCJdfSIsImp0aSI6IjkyRTQ0NkQ3OEQyN0Q2MEFGMzQwMjc5Q0Q0NTZFMEFCIiwiaWF0IjoxNzQ5ODI4OTE2LCJzY29wZSI6WyJkZXNfYXBpIiwib3JsX2FwaSIsInNjcyJdfQ.W4uM9A9_REYz4axmw-y86YvwddTENzyB0gGANk-OZ0kbZdcGNOuo5vEkVyRi5fCdPVpeAgsbTOh71ii8y-U_rvuZ2Ux-SEJqhgcrYHtLbUdFzyUWA4mryCtYsJX71MreMQ8i0Qj2fHcv4GvFG5zG3CjaRS7hrwnejwNvlqQ6qjGndH4LDyeb2MJR5eO71AbZlmSTcXzaatCbDHxibvIwzXv_vYMz8MCaO0lc_1pzU_GYrsgujdayUEkKjrJLbOx91-LcLvKicK1VF81FCnLBvpp48YLbqYApo9LX5og1EqDFmanU8CtbuWtcYj4j6fhJiqPVw4nsc-1Siqg3X--WZA' - config.environment='sandbox' - config.app_name="testApp" - config.app_version="2.3.1" - config.machine_name="AVL_WIN_007" - config.debugging=false - @api_client = AvalaraSdk::ApiClient.new config - @api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new @api_client - end - - describe 'test EInvoicing Documents endpoint' do - get_doc_request = AvalaraSdk::EInvoicing::V1::GetDocumentListRequestSdk.new - it 'should be able to call list documents without exception' do - result = nil - begin - result = @api_instance.get_document_list(get_doc_request) - p result - puts "Call Completed" - rescue AvalaraSdk::ApiError => e - puts "Exception #{e}" - @exception = true - end - expect(result).to be_truthy - end - end - -end \ No newline at end of file diff --git a/spec/integration/einvoicing_spec.rb b/spec/integration/einvoicing_spec.rb new file mode 100644 index 0000000..3570a48 --- /dev/null +++ b/spec/integration/einvoicing_spec.rb @@ -0,0 +1,34 @@ +require 'json' +require 'dotenv/load' +require 'securerandom' + +describe 'EInvoicingApi' do + before(:all) do + config = AvalaraSdk::Configuration.new + config.bearer_token = ENV['BEARER_TOKEN_EINVOICING'] + config.environment='sandbox' + config.app_name="testApp" + config.app_version="2.3.1" + config.machine_name="AVL_WIN_007" + config.debugging=false + @api_client = AvalaraSdk::ApiClient.new config + @api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new @api_client + end + + describe 'test EInvoicing Documents endpoint' do + get_doc_request = AvalaraSdk::EInvoicing::V1::GetDocumentListRequestSdk.new + it 'should be able to call list documents without exception' do + result = nil + begin + result = @api_instance.get_document_list(get_doc_request) + p result + puts "Call Completed" + rescue AvalaraSdk::ApiError => e + puts "Exception #{e}" + @exception = true + end + expect(result).to be_truthy + end + end + +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f8cf7ae..cde3af5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,15 +1,8 @@ -=begin -#Avalara Shipping Verification only - -#API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. This API is currently in beta. - -SDK Version : 2.4.6 +require 'bundler/setup' # ← makes sure your Gemfile gems—and Ruby’s stdlib!—are on $LOAD_PATH +Bundler.setup(:default, :test) +require 'avalara_sdk' # ← now safe to load your lib (it can `require 'base64'`) # ← your library, which itself does `require 'base64'` -=end - -# load the gem -require File.expand_path('../../lib/avalara_sdk', __FILE__) # The following was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause From 67711aff9d5cd3dbaf09dd0bd8c332efebffd1ca Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Thu, 19 Jun 2025 12:54:14 -0700 Subject: [PATCH 3/7] Tweak ruby versions --- .github/workflows/gem-push.yml | 2 +- .github/workflows/test.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 284b128..5c0ec6a 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["2.7"] + ruby: ["3.3, 3.4"] runs-on: ${{ matrix.os }} permissions: contents: write diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 184f461..6fc08a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["2.7"] + ruby: ["3.3, 3.4"] + runs-on: ${{ matrix.os }} permissions: contents: read From 70c6951df4ffde546371aea7485a0c3c3ba9ac42 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Thu, 19 Jun 2025 12:55:20 -0700 Subject: [PATCH 4/7] Fix versions --- .github/workflows/gem-push.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 5c0ec6a..65e8782 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["3.3, 3.4"] + ruby: ["3.3.8, 3.4.1"] runs-on: ${{ matrix.os }} permissions: contents: write diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6fc08a7..504ec1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["3.3, 3.4"] + ruby: ["3.3.8, 3.4.1"] runs-on: ${{ matrix.os }} permissions: From 2603b41e6d26b19181ca5351d014aa5991af4290 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Thu, 19 Jun 2025 12:56:52 -0700 Subject: [PATCH 5/7] Fix versiuon --- .github/workflows/gem-push.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 65e8782..2bc76dd 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["3.3.8, 3.4.1"] + ruby: ["3.3", "3.4"] runs-on: ${{ matrix.os }} permissions: contents: write @@ -27,7 +27,7 @@ jobs: echo $VERSION echo ${{ env.VERSION }} - name: Set up Ruby Versions - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@v2 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 504ec1c..251010a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["3.3.8, 3.4.1"] + ruby: ["3.3", "3.4"] runs-on: ${{ matrix.os }} permissions: @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Ruby Versions - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@v2 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 236ffb3e654d2efe7c9fd7c5691a24ff9b928427 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Thu, 19 Jun 2025 12:57:46 -0700 Subject: [PATCH 6/7] FFix version --- .github/workflows/gem-push.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 2bc76dd..606eba3 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -27,7 +27,7 @@ jobs: echo $VERSION echo ${{ env.VERSION }} - name: Set up Ruby Versions - uses: ruby/setup-ruby@v2 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 251010a..57ca54a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Ruby Versions - uses: ruby/setup-ruby@v2 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From d4b1cb0e470af4f7ae9a7f8acf1e79ce79bff8e7 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Thu, 19 Jun 2025 13:01:10 -0700 Subject: [PATCH 7/7] Ruby adjust version support --- .github/workflows/gem-push.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 606eba3..d70aecc 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["3.3", "3.4"] + ruby: ["3.2", "3.3"] runs-on: ${{ matrix.os }} permissions: contents: write diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57ca54a..0b04392 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ["3.3", "3.4"] + ruby: ["3.2", "3.3"] runs-on: ${{ matrix.os }} permissions: